Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4472388

Can't change various button properties when running app in web start

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • None
    • beta2
    • sparc
    • solaris_7

      The following code should make it so that the background color will turn to blue when a button is clicked, it doesn't work when the app is launched via web start.

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.plaf.ColorUIResource;


      public class UIManagerTester {
          public static void main( String[] args ) {
              try {
                  UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
              } catch(Exception e) {
                  e.printStackTrace();
              }
              new JButton();
              UIManager.put("Label.foreground", new ColorUIResource(Color.red));
              UIManager.put("Button.select", new ColorUIResource(Color.blue));
              UIManager.put("Button.foreground", new ColorUIResource(Color.red));
              UIManager.put("Button.background", new ColorUIResource(Color.black));


              JFrame frame = new JFrame( "Test" );

              JPanel aPanel = (JPanel) frame.getContentPane();
              aPanel.setLayout(new FlowLayout());
              aPanel.add(new JLabel("This is test label"));
              JButton button = new JButton("Test Button");
              button.setContentAreaFilled(true);
              aPanel.add(button);

              frame.addWindowListener(new WindowAdapter() {
                  public void windowClosing(WindowEvent e) {
                      System.exit(0);
                  }
              });

              frame.pack();
              frame.show();
          }
      }

            svioletsunw Scott Violet (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: