I've tried to use some Apple's client properties to get toggle buttons on a toolbar, just like iCal's "Day", "Week", and "Month" buttons. When unselected, the buttons look great. When selected, however, the text colour is black instead of white. Does anyone know how I can easily rectify this?
I'm using Java 5 on Leopard, if that's important.
Many thanks,
Steve --- Repro code follows:
import javax.swing.*; import java.awt.*;
public class ToggleButtonTest extends JFrame {
public static void main(String[] args) { JFrame frame = new JFrame(); final Container contentPane = frame.getContentPane(); contentPane.setLayout(new FlowLayout());
final JToggleButton button = new JToggleButton("Toggle Button");
button.setFocusable(false); button.putClientProperty("JButton.buttonType", "segmentedTextured"); button.putClientProperty("JButton.segmentPosition", "only");
contentPane.add(button);
frame.pack(); frame.setVisible(true); } }
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden