Hi everyone, I'm developing a new program. ;)

My "dilema" is as follows: :S

Let's say that I have a Java component, a calendar, shown in the GUI and I want to cover it with and invisible label or something so it can't be modified by the user. I don't want to use object.setEditable(false) because it changes the background color of the domponent and object.setBackground(Color.someColor) is not working... :( maybe because of a bug.. I don't know.

I'm looking forward to your responses.
All ideas are welcome! :)
Thanks in advance.

Recommended Answers

All 2 Replies

JTextComponent class has a method: setDisabledTextColor(Color). it will work for subclasses JTextField, JTextArea...,etc ...

So, you can use this method with the components inherited from JTextComponent in your Calendar or whatever.

JTextComponent class has a method: setDisabledTextColor(Color). it will work for subclasses JTextField, JTextArea...,etc ...

So, you can use this method with the components inherited from JTextComponent in your Calendar or whatever.

Mmmm, your idea is interesting. At first I didn't get it. Let me try it and let's see what it happens. But what I want is to change the background without the method setBackgroundColor or blocking it with and invisible label.
Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.