What are your best Swing design patterns and tips? [closed]

Never derive from JDialog, JFrame or JInternalFrame for defining your forms, dialogs…

Rather derive from JPanel. This will bring you the follwing advantages:

  • possibility to later change from a
    JFrame to a JDialog for instance
    (because user changed his mind)
  • you can reuse one panel instance from one JDialog to another (JDialog are generally not reusable because they are constructed with a reference to their “parent”, a frame or another dialog)
  • you can later on change replace
    JDialog with a more functional
    subclass from a 3rd-party framework.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)