Hello,
I want to create a look and feel much like the windows look and feel, but
different size fonts.
I extended WindowsLookAndFeel.java (com.sun.java.swing.plaf.windows). Here
is my class:
public class MyWindowsLAF extends WindowsLookAndFeel {
public String getID(){ return "MyWindowsLAF"; }
public String getName(){return "My Look And Feel for Windows"; }
public String getDescription(){ return "L&F for Windows";}
public boolean isNativeLookAndFeel () { return false; }
public boolean isSupportedLookAndFeel() { return true;}
protected void initComponentDefaults(UIDefaults table)
{
super.initComponentDefaults(table);
FontUIResource commonFont = new FontUIResource("Dialog", Font.PLAIN,
11);
Object [] defaults = {
"Button.font", commonFont,
"Button.margin", new InsetsUIResource(1, 12, 1, 12),
"RadioButton.font", commonFont,
"CheckBox.font", commonFont,
"ColorChooser.font", commonFont,
"ComboBox.font", commonFont,
"FileChooser.font", commonFont,
"Label.font", commonFont,
"List.font", commonFont,
"MenuBar.font", commonFont,
"MenuItem.font", commonFont,
"RadioButtonMenuItem.font", commonFont,
"CheckBoxMenuItem.font", commonFont,
"Menu.font", commonFont,
"PopupMenu.font", commonFont,
"OptionPane.font", commonFont,
"Panel.font", commonFont,
"ProgressBar.font", commonFont,
"ScrollPane.font", commonFont,
"Viewport.font", commonFont,
"TabbedPane.font", commonFont,
"Table.font", commonFont,
"TableHeader.font", commonFont,
"TextField.font", commonFont,
"PasswordField.font", commonFont,
"TextArea.font", commonFont,
"TextPane.font", commonFont,
"EditorPane.font", commonFont,
"TitledBorder.font", commonFont,
"ToolBar.font", commonFont,
"ToolTip.font", commonFont,
"Tree.font", commonFont,
"ToggleButton.font", commonFont,
};
table.putDefaults(defaults);
}
Everything works fine until my program uses a platform icon (fi TreeOpen.gif
or HardDrive.gif)
Then i get the message:
mypackage.MyWindowsLAF/icons/HardDrive.gif not found
mypackage.MyWindowsLAF/icons/TreeOpen.gif not found
Does anybody have an idea about what i do wrong?
I set the look and feel in the following manner in the initialisation of my
applet:
String laf;
if (!RunningOnMac()){
try{
laf = MyWindowsLAF.getClassPath();
}
catch(Exception e){
e.printStackTrace();
laf = UIManager.getSystemLookAndFeelClassName();
}
}
else // set system look and feel.
laf = UIManager.getSystemLookAndFeelClassName ();
}
Greetings
Sofie
Sofie Ravyts
Barco Commercial Printing
Tramstraat 69
B-9052 Zwijnaarde (Gent)
email: [EMAIL PROTECTED]
tel: +32 9 216 9335
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing