Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Appearance of "segmentedTextured" JToggleButtons



Hi there

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



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.