RightSoBosco
asked on
Wrapping Swing Components
Hi, I want to create wrapper classes for most of the Swing GUI Components such as JButton, JTextField etc etc.
I want to keep this very simple but how do I go about doing this properly?
For example in the case of JButton, I will want a wrapper class MyJButton which will have colours and sizes specified by my wrapper class. So when I want a button I create a myJButton which will have a specific look and feel.
How do you properly wrap these classes. Would you simply subclass for example
public class MyJButton extends JButton
and then just set up the various attributes ?
Or alternatively does anyone know of any Look and Feel coding guidelines ?
I want to ensure that everyone when using the Swing components are forced to adhere to the same look and feel.
Thanks for your help
Regards Dave
I want to keep this very simple but how do I go about doing this properly?
For example in the case of JButton, I will want a wrapper class MyJButton which will have colours and sizes specified by my wrapper class. So when I want a button I create a myJButton which will have a specific look and feel.
How do you properly wrap these classes. Would you simply subclass for example
public class MyJButton extends JButton
and then just set up the various attributes ?
Or alternatively does anyone know of any Look and Feel coding guidelines ?
I want to ensure that everyone when using the Swing components are forced to adhere to the same look and feel.
Thanks for your help
Regards Dave
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
jgoodies.com already have lots of freel, mature look and feels
Instead of creating a wrapper for each a better way would be to use the UIManager class to specify the default properties of the various component types
ASKER
Thanks for all the links :)
objects
When you say I should use the UIManager class to specify all the default properties.
Would this be similiar to the way the way it was done with this:
http://liquidlnf.sourceforge.net/
or is the liquidinf way too over the top ?
objects
When you say I should use the UIManager class to specify all the default properties.
Would this be similiar to the way the way it was done with this:
http://liquidlnf.sourceforge.net/
or is the liquidinf way too over the top ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to generate the UI Defaults file yourself: http://www.rgagnon.com/javadetails/java-0507.html
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the all the links and help there.
I split the points amonts three different parts which helped me out the most.
Thanks again :-)
I split the points amonts three different parts which helped me out the most.
Thanks again :-)
Thanks
:)
Java Look and Feel Design Guidelines, Second Edition: http://java.sun.com/products/jlf/ed2/guidelines.html