Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
segmentedTextured JButtons render poorly on OpenJDK 7
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

segmentedTextured JButtons render poorly on OpenJDK 7



I''m using OpenJDK 1.7.0_04. I'm using the client property "segmentedTextured" on some buttons. The top and bottom of the buttons are not rendered. Here's the simplest reproduction code I've been able to create.

import javax.swing.*;
import java.awt.*;

public class SegmentedTexturedButtonTest {

    public static void main(String[] args) {
        JToggleButton leftButton = new JToggleButton("Left Button");
        leftButton.putClientProperty("JButton.buttonType", "segmentedTextured");
        leftButton.putClientProperty("JButton.segmentPosition", "first");
        leftButton.setFocusable(false);

        JToggleButton rightButton = new JToggleButton("Right Button");
        rightButton.putClientProperty("JButton.buttonType", "segmentedTextured");
        rightButton.putClientProperty("JButton.segmentPosition", "last");
        rightButton.setFocusable(false);
        
        JPanel contentPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
        contentPane.add(leftButton);
        contentPane.add(rightButton);

        JFrame frame = new JFrame("Test");
        frame.setContentPane(contentPane);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}

This problem occurs with JToggleButtons that use icons too, in fact worse so.

The same code renders properly on Apple's Java 6.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

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 © 2011 Apple Inc. All rights reserved.