Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation and SwingUtilities

Sri Rangan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on an application to display Question and Answers , I have to display numerous JTextField, JComboBox,JCheckBox, JRadioButton,JTable components as Answers. All these components are dynamically built based on the user profile. I have to validate when the user answers each question. Based on the validation I have to enable or disable the question and answers.If the validation fails, I have to show a JOptionPAne error message to the user.
1) I am NOT using SwingUtilities in my code. In connection with my application, what are the areas I have to use SwingUtilities.
2)Right now in many places I am calling repaint() and revalidate() direstly (NOT in thread). Is it OK?
3)Most part is working fine except JTextField. I am using FocusLost to validate the JTextField.Some times ONLY the JTextField componenets becomes non-editable when the question ans answers are display on screen. If the user doed ALT+TAB, JTextFields are live again.What could cause this problem?
4)When I throw an error message, shold I have to call them via SwingUtilities.invokeLater()?
Any guidance would be realy helpful.
Thanks in Advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic