The second question is about the JTextField. I set the textfield to a certain size, but I can input more than that fixed size. How should I modify my code to in order to set that the input is not more than the fix size?
<java> JLabel username = new JLabel("User Name"); final JTextField usernameField = new JTextField(12); </java>
The third question is about JSplitPane. I want to split my panel into two parts, so I use a JSplitPane. The problem with it is that the user resizes the divider. Is there a way to prevent the divider from begin moved?
The last question is about file I/O. I have a file that I will use to read and write data to it. Is there a class or an easy way I can use to implement writing process? Because when you write, delete, or change something in the middle of the file, it will affect the data below.
For your JTable you can subclass DefaultTableModel and override the isCellEditable(int row, int column) method to return false. Be sure to use setModel(your_table_model) on your JTable.
Use a different component .. like two JPanels or two JTextAreas instead of a JSplitPane. I can't think of why you would use a JSplitPane if you didn't want to 'split'.
Your IO question is unclear. Do you mean to update the ui as the file is modified? Maybe you could explain the need to do this. Reading and writing to/from a file is simple enough as is notifying your component models of data changes.
I hope this helps and I don't mind helping you solve the last two issues. Just give me some more detail to work with.