JideButton background

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JideButton background

Postby andy08 » Sat Jan 31, 2009 1:16 am

Hi,
I use jide-oss-2.5.0 version.In a simple case,I just add JideButton to the panel.However,the first added JideButton has a default orrange background.Only after other components getfocus,the default orrange background disappear.
So,
1. I want to know why the first added JideButton get focus?
2. Which way is better to customize the JideButton or other JIDE components background? UI delegeate or LookAndFeel?
I just want to use my own painter.

Thanks:)
andy08
 
Posts: 5
Joined: Sat Jan 31, 2009 12:56 am

Re: JideButton background

Postby JIDE Support » Sat Jan 31, 2009 6:56 am

1. Swing automatically put the focus on the first focusable component in the UI. JideButton's focus indicator is to use orange color.
2. There are setBackgroundOfState method you can use to change the background.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: JideButton background

Postby andy08 » Sat Jan 31, 2009 7:13 pm

Then how can I make the orange background disappear when the GUI initialize without change the default BackgroundOfState?

I hava try to make a other JComponent getFocus.Say,call JComboBox.requestFocusInWindow.However,it doesn't work :|
I don't like a button has a different bg color at GUI initialize.

Thanks :P
andy08
 
Posts: 5
Joined: Sat Jan 31, 2009 12:56 am

Re: JideButton background

Postby JIDE Support » Sat Jan 31, 2009 8:13 pm

You need to use SwingUtiltites.invokeLater to requestFocus on other component. Or you can call JideButton#setFocusable(false) and setRequestFocusEnabled(false).
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 5 guests