Results 1 to 7 of 7
Thread: JButton color
- 09-24-2011, 02:32 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 31
- Rep Power
- 0
- 09-24-2011, 02:37 PM #2
Re: JButton color
There are methods to do those things. Have you read the API doc for the JButton class?
- 09-24-2011, 02:45 PM #3
Member
- Join Date
- Aug 2011
- Posts
- 31
- Rep Power
- 0
Re: JButton color
no... ill go look at that, thanks :)
-
Re: JButton color
One way to do what you want is to swap the JButton's icon and rather than disable the JButton, disable its ActionListener (have an if block that calls return if you want the button to not do anything).
- 09-24-2011, 09:11 PM #5
Re: JButton color
hmmmm....
you can set the background of JButton in both cases when JButton is enabled or disabled...
try this....
buttonname.setBackground(Color.RED);
- 09-24-2011, 09:12 PM #6
Re: JButton color
try with different colors...
- 09-25-2011, 02:49 AM #7
Member
- Join Date
- Aug 2011
- Posts
- 31
- Rep Power
- 0
Similar Threads
-
RGB to Color Name
By zit1343 in forum Advanced JavaReplies: 12Last Post: 04-24-2011, 06:02 PM -
[COLOR="Navy"]execute .bat file in mysql [/COLOR]
By msankar.ravi in forum NetworkingReplies: 0Last Post: 02-24-2010, 04:27 AM -
How to change the default background color of a DISABLED JButton
By ryogananda in forum Java AppletsReplies: 4Last Post: 03-21-2009, 05:48 PM -
Disabled JButton font color
By p900128 in forum Advanced JavaReplies: 1Last Post: 07-24-2008, 08:16 AM -
JButton onClick change color background
By behrk2 in forum AWT / SwingReplies: 6Last Post: 07-09-2008, 04:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks