Article View: borland.public.jbuilder.java.swing
Article #7603Re: Customized slider knob imagery
From: Torsten Welches
Date: Sun, 07 Jan 2001 13:42
Date: Sun, 07 Jan 2001 13:42
34 lines
1951 bytes
1951 bytes
Lars,
please note that the snippet I had posted does not handle L&F changes. Once
updateUI gets called on your JSlider your new thumb will be lost.
Try adding a button like this and look what happens:
JButton btnSwitchLF = new JButton("switch L&F");
btnSwitchLF.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(yourFrameOrWhatever);
//JSlider.updateUI will be called...
} catch (Exception ex) {
System.out.println("CrossPlatformLookAndFeel not supported?!
Shouldn't happen!");
}
}
});
If you'd plan to use it in production code you would probably have to adress
the L&F issues.
Viel Gr��e aus K�ln,
Torsten
Lars Thuring schrieb in Nachricht <3A57A5E1.10B75D6B@t-online.de>...
>Cool!
>
>It works nicely (without any changes)! Thank you.
>
>Lars
Technical Details
Message-ID:
<3a5872c8_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.online.be!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!news.imp.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!dnews!195.14.251.159References:
<3A567ADC.25868A32@t-online.de> <3a56f931$1_1@dnews> <3A57A5E1.10B75D6B@t-online.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,f6e07f74041fb29d X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2001-01-07 05:45:36 PST From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Newsgroups: borland.public.jbuilder.java.swing References: <3A567ADC.25868A32@t-online.de> <3a56f931$1_1@dnews> <3A57A5E1.10B75D6B@t-online.de> Subject: Re: Customized slider knob imagery Date: Sun, 7 Jan 2001 14:42:17 +0100 Lines: 37 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Host: 195.14.251.159 Message-ID: <3a5872c8_1@dnews> X-Trace: 7 Jan 2001 05:44:40 -0800, 195.14.251.159 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.online.be!oleane.net!oleane!fr.clara.net!heighliner.fr.clara.net!news.imp.ch!news-zh.switch.ch!newsfeed-zh.ip-plus.net!news.ip-plus.net!bornews.borland.com!dnews!195.14.251.159