If you create a JMenuItem and update the text later, the size of the JMenuItem
doesent update correctly.

here is a testcase:

package test;

import java.awt.Dimension;

import javax.swing.*;        

public class SwingTest {
    private static void createAndShowGUI() {

        JFrame frame = new JFrame("HelloWorldSwing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JMenuBar bar = new JMenuBar();
        JMenu menu = new JMenu("asdfasd");
        JMenuItem item1 = new JMenuItem("aa");
        menu.add(item1);
        bar.add(menu);

        frame.setSize(new Dimension(600, 450));        
        frame.setJMenuBar(bar);
        item1.setText("Long name");
        frame.setVisible(true); 
    }

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}


-- 
           Summary: JMenuItem doesent get updated correctly
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: swing
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: asraniel at fryx dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24417



_______________________________________________
Bug-classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-classpath

Reply via email to