• Post Reply Bookmark Topic Watch Topic
  • New Topic

JYearChooser() stop changing color  RSS feed

 
erin lang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

I have in a class

public class SomeDialog extends JDialog {

private JYearChooser textfield = new JYearChooser();

}

this shows up perfect in the dialog box but a couple of the users find it annoying that when you click in the box to enter a year instead of using arrows. The font changes to green color.

Does anyone know how to disable the changing to green or disable the change color all together.

I found some stuff on this and how changing color is default setting depending on if int or text but nothing says anthing about disabling it.

any help appreciated.
 
Mark Van Tuyl
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JYearChooser inherits from JComponent, so you should be able to use the setForeground method.
 
erin lang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ...I looked up the setForeground...and it worked kinda. It does set the color to whatever I want intitially, but as soon as a user click in the box it changes to green.

Any other ideas on how to make it not do that anymore.

I thought of maybe using a listener to changed the color back to black when a user clicks inside the box but that seems over kill on some thing should be simple.

thanks for any help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!