473,804 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change look of disabled JButton

Hello

How can I change the look of a disabled JButton? I have made a boardgame
with a brown background and brown buttons. I have also put an imageicon on
the buttons that has a colored image on it. When I disable the buttons, the
colored image is turned into grey which screws up the look of my game.

Can I change the grey color on a disabled button? Or do I have to keep it
enabled, and attach another imageicon with different color to show the user
he can't click the button?

Also, I can sometimes see a blue/gray line around my buttons. I want to get
rid of it, so I guess it has something to do with setBorder, but I can't
find it.

Thx,
Oswald
Apr 21 '07 #1
0 4391

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7909
by: Matt Rapoport | last post by:
I'd like to programmatically remove a service or change its startup type to disabled. I know how to remove it from the command line but is there another way using the win32 extensions? I've looked through the win32 help file but when it lists the arguments for its methods (such as win32service.ChangeServiceConfig) it doesn't give a dictionary of possible arguments. How can I tell what int is associated with what Access Type (in...
7
2185
by: Tim Rogers | last post by:
Hi folks, this is a resolution-detect script that I used on a site. As you can see it is designed to detect when the screen resolution falls below a certain level then load an alternative style sheet HOWEVER, is it possible to make a change to the code that will not only make it respond to windows with widths of less than 800 pixels but ALSO heights of less than 600 pixels. I'm a complete novice when it comes to .js so and help would...
4
1688
by: porky008 | last post by:
I put in a next and previous button but it crashes when I run it. I also need it to loop around to the first or last if at the ends. Can some one help me with this? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.JFrame.*; import java.io.*; class Testing
7
11829
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007 style look of my form. How can i change the colour that control assumed when it's disabled? Thanks! Gary-
0
1154
by: ghostrider | last post by:
My program seems to slove for all the mortgages at once. And will not clear out the pane and accept another choice by the user. Can someone steer me in the right direction with this problem. My program is shown below! import java.awt.*; import javax.swing.*; import java.math.*; import java.awt.event.*; import java.text.*;
9
9839
by: aleplgr | last post by:
Hi! I'm trying to let the end-user select the language of the menues I'm showing him. To do that I've got this Selector class that shows the end user a combo box, a label and a button. In the combo box the user selects the language (English,Spanish,French,..) and when he clicks in the button shows the label in the language selected. This works fine but it's just one form, I need to change the language of all the menues in an application, so...
6
2143
by: vijaykumarsharma | last post by:
Hi all I am having a problem with JButton. JButton b=new JButton("save"); how can i get the name of the JButton b. Please give the anser for me
5
7454
by: milk242 | last post by:
Hi everyone I'm trying to change what shows up in the contentpane depending on what button you press. Say you press a button labeled "Customer", it would add textfields to the content pane. I thought I could just add the action int eh actionPerformed method but doesn't seem to work. Thanks for your help! public class ButtonDemo extends JFrame implements ActionListener {
12
3659
by: yeshello54 | last post by:
So I want to set the background color of a Jbutton. I know that the normal way to do such a thing is down the following way: JButton button = new JButton("xxxx"); button.setBackground(Color.RED); but in my program i add my Jbutton the following way.. horizontalBox2=Box.createHorizontalBox(); horizontalBox2.add(new JButton("Black"));
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.