• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Skins for java application

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As a quick intro, i am developing look and feel implementation for my swing application. I am having a set of internal frames in my application.
When i try to set the button border in UIDefaults, even the minimize, maximize and close buttons of internal frames are getting affected. Can any one help me out with this.
This is the code i used to set the UIDefaults in a class derived from javax.swing.plaf.basic.BasicLookAndFeel
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
Object[] defaults = {
"Button.font", new FontUIResource("Arial", Font.BOLD, 12 ),
"Button.border",new BorderUIResource(new OvalBorder()),
"Button.margin", new InsetsUIResource(8, 8, 8, 8)
};
table.putDefaults( defaults );
}
OvalBorder class implements javax.swing.border.Border interface

Waiting for a solution,
fazal.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The button Border is painted with method paintBackground() inside the BasicButtonUI, you can change the border with the graphics object

syed fazal faheem wrote:Hi,
As a quick intro, i am developing look and feel implementation for my swing application. I am having a set of internal frames in my application.
When i try to set the button border in UIDefaults, even the minimize, maximize and close buttons of internal frames are getting affected. Can any one help me out with this.
This is the code i used to set the UIDefaults in a class derived from javax.swing.plaf.basic.BasicLookAndFeel
 protected void initComponentDefaults(UIDefaults table) {
   super.initComponentDefaults(table);
   Object[] defaults = {
     "Button.font", new FontUIResource("Arial", Font.BOLD, 12 ),
     "Button.border",new BorderUIResource(new OvalBorder()),
     "Button.margin", new InsetsUIResource(8, 8, 8, 8)
     };
    table.putDefaults( defaults );
 }
OvalBorder class implements javax.swing.border.Border interface

Waiting for a solution,
fazal.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic