Bonjour,
Je viens encore poser une question (enfin mon problème) concernant encore la modification du L&F (avec Synth).
Je suis en train de configurer mon jscrollbar, tout marche sauf une seule chose : l'état "Pressed" du Thumb. En effet, je souhaite que lorsque je clique sur le Thumb, il change sa couleur de background.
Mais dans mon painter, lorsque je récupére l'état de mon contexte (SynthContext), il m'affiche soit "Enabled" soit "Mouse over" mais jamais "Pressed", même si je clique dessus.
Sauriez-vous pourquoi je peux avoir tous les autres états sauf pressed?
Voici mon code :
Merci =)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 if ((context.getComponentState() & SynthConstants.PRESSED) == SynthConstants.PRESSED) { backgroundColor = UIManager.getColor(Color.RED); } else if ((context.getComponentState() & SynthConstants.DISABLED) == SynthConstants.DISABLED) { backgroundColor = UIManager.getColor(Color.BLUE); } else if ((context.getComponentState() & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER) { backgroundColor = UIManager.getColor(Color.BLUE); } else { backgroundColor = UIManager.getColor(Color.BLUE); }
Partager