f



differense of look between 1.4.2 and 1.4.1

Hello,

when compiling and running with jdk 1.4.2 (or higher) the look is totally
different then when i use 1.4.1 fe mouse over on buttons seems different,
the look of the radiobuttons is different , how can i solve this

fe how i call a button
 trashbutton.setIcon(new ImageIcon(images.getString("TRASH20")));
    trashbutton.setPressedIcon(new
ImageIcon(images.getString("TRASH20_IN")));
    trashbutton.setRolloverIcon(new
ImageIcon(images.getString("TRASH20_OUT")));
    trashbutton.setDisabledIcon(new
ImageIcon(images.getString("TRASH20_DIS")));
    trashbutton.setToolTipText(recources.getString("REMOVE_NODE"));
    trashbutton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        EditRemoveMenuItem_actionPerformed(e);
      }
    });

    trashbutton.setFocusPainted(false);
    trashbutton.setBorderPainted(false);
    trashbutton.setMaximumSize(new Dimension(40, 40));
    trashbutton.setMinimumSize(new Dimension(40, 40));
    trashbuttons.etPreferredSize(new Dimension(40, 40));
    trashbutton.setBackground(new Color(15, 40, 70));
    trashbutton.setForeground(new Color(15, 40, 70));


it seems when i go with the mouse over the buttons in jdk 1.4.2 the
backgroundcolor disapears and i need to set for mouseover also a color
or are there other parameters to set
there are also border that appears around the buttons on jdk 1.4.2 and not
on lower versions

can i find any solutions about this on the net?



thanks Sven


0
Sven
2/17/2004 9:05:18 PM
comp.lang.java.gui 8286 articles. 0 followers. Post Follow

4 Replies
808 Views

Similar Articles

[PageSpeed] 56

Sven Goetgeluck wrote:

> when compiling and running with jdk 1.4.2 (or higher) the look is totally
> different then when i use 1.4.1 fe mouse over on buttons seems different,
> the look of the radiobuttons is different , how can i solve this

To help us understand your problem please provide the following
information: JRE vendor, look&feel, OS, OS version. For example:
Sun, Sun Windows l&f, Windows XP
Sun, Java look&feel, Windows 2000
IBM, Skin look&feel, Linux,
Apple, Aqua look&feel, OS X

Karsten
0
Karsten
2/17/2004 9:33:16 PM
hi,

running on Windows XP Home
sun jre 1.4.2_02 win32
 public static void main(String[] args) {
    try {

      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      UIManager.put("CheckBox.icon", new components.MyCheckIcon());
      UIManager.put("CheckBox.foreground", new ColorUIResource(33, 161,
33));
      UIManager.put("ScrollPaneUI",
"com.sun.java.swing.plaf.windows.WindowsScrollPaneUI");
    }
    catch (Exception e) {
      System.out.println(e.toString());
    }

    new Application1();
  }

hope this helps you


sven

"Karsten Lentzsch" <Karsten@JGoodies.com> schreef in bericht
news:c0u1al$lhl$05$1@news.t-online.com...
> Sven Goetgeluck wrote:
>
> > when compiling and running with jdk 1.4.2 (or higher) the look is
totally
> > different then when i use 1.4.1 fe mouse over on buttons seems
different,
> > the look of the radiobuttons is different , how can i solve this
>
> To help us understand your problem please provide the following
> information: JRE vendor, look&feel, OS, OS version. For example:
> Sun, Sun Windows l&f, Windows XP
> Sun, Java look&feel, Windows 2000
> IBM, Skin look&feel, Linux,
> Apple, Aqua look&feel, OS X
>
> Karsten


0
Sven
2/17/2004 10:04:21 PM
Sven Goetgeluck wrote:

> hi,
> 
> running on Windows XP Home
> sun jre 1.4.2_02 win32

The implementation of the system look&feel has changed
in 1.4.2 to better mimic the native Windows XP look&feel.
Where the previous implementations have only emulated
the Windows classic appearance and behavior.
The check box, buttons and other components are now active,
i. e. they look different if the mouse is over the component.

You can disable the XP style of Suns Windows look&feel
by setting the system property "swing.noxp", for example:
    java -Dswing.noxp  MyClass

>       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
>       UIManager.put("CheckBox.icon", new components.MyCheckIcon());
>       UIManager.put("CheckBox.foreground", new ColorUIResource(33, 161,
> 33));
>       UIManager.put("ScrollPaneUI",
> "com.sun.java.swing.plaf.windows.WindowsScrollPaneUI");
>     }
>     catch (Exception e) {
>       System.out.println(e.toString());
>     }

Btw, this code prevents your application from running properly
on platforms other than Windows - and it may fail at all.
The look&feel implementation may change, and I'd say it is
unsafe to use a custom icon implementation.
You set a platform-specific scrollpane UI that won't exist
or won't run on other platforms.

All your code is fine if you have full control over the
Java runtime used to run your application. If not, you
better remove the custom settings.

Hope this helps,
Karsten
0
Karsten
2/17/2004 10:48:38 PM
txs,

but the arguments don't work very strange is it possible to override those
settings by a own jbutton?
allready tried
 -Dswing.noxp=true

sven
"Karsten Lentzsch" <Karsten@JGoodies.com> schreef in bericht
news:c0u5nv$aja$00$1@news.t-online.com...
> Sven Goetgeluck wrote:
>
> > hi,
> >
> > running on Windows XP Home
> > sun jre 1.4.2_02 win32
>
> The implementation of the system look&feel has changed
> in 1.4.2 to better mimic the native Windows XP look&feel.
> Where the previous implementations have only emulated
> the Windows classic appearance and behavior.
> The check box, buttons and other components are now active,
> i. e. they look different if the mouse is over the component.
>
> You can disable the XP style of Suns Windows look&feel
> by setting the system property "swing.noxp", for example:
>     java -Dswing.noxp  MyClass
>
> >
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
> >       UIManager.put("CheckBox.icon", new components.MyCheckIcon());
> >       UIManager.put("CheckBox.foreground", new ColorUIResource(33, 161,
> > 33));
> >       UIManager.put("ScrollPaneUI",
> > "com.sun.java.swing.plaf.windows.WindowsScrollPaneUI");
> >     }
> >     catch (Exception e) {
> >       System.out.println(e.toString());
> >     }
>
> Btw, this code prevents your application from running properly
> on platforms other than Windows - and it may fail at all.
> The look&feel implementation may change, and I'd say it is
> unsafe to use a custom icon implementation.
> You set a platform-specific scrollpane UI that won't exist
> or won't run on other platforms.
>
> All your code is fine if you have full control over the
> Java runtime used to run your application. If not, you
> better remove the custom settings.
>
> Hope this helps,
> Karsten


0
Sven
2/17/2004 11:15:49 PM
Reply: