0

I installed a new version of Eclipse Kepler (4.3.1) and WindowBuilder Pro. If I create a new SWING Window Application my AWT components are invisible or black in the Design-View.

The Program itself shows all added components if I build it. The J-Components like JButton, JLabel etc. work fine, just the AWT components are broken.

screenshot

Here is the code that the WindowBuilder generated:

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.Button;

public class test1 {

private JFrame frame;

/**
 * Launch the application.
 */
public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
        public void run() {
            try {
                test1 window = new test1();
                window.frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}

/**
 * Create the application.
 */
public test1() {
    initialize();
}

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frame = new JFrame();
    frame.setBounds(100, 100, 450, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);

    Button button = new Button("New button");
    button.setBounds(10, 45, 117, 29);
    frame.getContentPane().add(button);

    Button button_1 = new Button("New button");
    button_1.setBounds(10, 10, 117, 29);
    frame.getContentPane().add(button_1);
}
}

The code itself works fine, it is just my view in the design-tab that is broken. Does anyone know how I can fix this?

Or maybe there is a WindowBuilder and AWT related setting that I don't know about.

My System:

  1. OS X 10.9
  2. Eclipse 4.3.1
  3. WindowBuilder Pro (Integration Version for Kepler)

Thanks

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
www40
  • 285
  • 1
  • 7
  • 19
  • 1) Why AWT rather than Swing? See this answer on [Swing extras over AWT](http://stackoverflow.com/a/6255978/418556) for many good reasons to abandon using AWT components. If you need to support older AWT based APIs, see [Mixing Heavyweight and Lightweight Components](http://www.oracle.com/technetwork/articles/java/mixing-components-433992.html). 2) For better help sooner, post an [SSCCE](http://sscce.org/). – Andrew Thompson Dec 11 '13 at 01:30
  • 1
    I need to use AWT, we do this in school so im forced to use AWT instead of Swing. – www40 Dec 11 '13 at 19:11
  • I would drop out of school – everton Dec 11 '13 at 19:45
  • Well put a rocket up the school. They are teaching entirely redundant technology that nobody uses in the real world any longer. ..In fact, ask them if they would mark you down for using Swing. – Andrew Thompson Dec 13 '13 at 03:37

0 Answers0