Hello,
I created this Application with WindowBuilderPro using JFrame:
package te;
import java.awt.Cursor;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.UIManager;
public class te{
private JFrame frmXdxxxrt;
private JTextField textField;
private final JButton button = new JButton("schliessen");
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
te window = new te();
window.frmXdxxxrt.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public te() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmXdxxxrt = new JFrame();
frmXdxxxrt.setVisible(true);
frmXdxxxrt.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
frmXdxxxrt.setTitle("xdxxxrt");
frmXdxxxrt.setForeground(UIManager.getColor("Button.light"));
frmXdxxxrt.setBackground(UIManager.getColor("Button.highlight"));
frmXdxxxrt.setAlwaysOnTop(true);
frmXdxxxrt.setBounds(100, 100, 450, 300);
frmXdxxxrt.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmXdxxxrt.getContentPane().setLayout(null);
textField = new JTextField();
textField.setBounds(90, 96, 285, 28);
frmXdxxxrt.getContentPane().add(textField);
textField.setColumns(10);
button.setSelected(true);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
System.out.println("this message doesn't appear on OS X");
System.exit(0);
}
});
button.setBounds(151, 163, 119, 29);
frmXdxxxrt.getContentPane().add(button);
}
}
When i build and run it the Button doesn't react. When I copy the code to my Windows-Installation it works perfectly.
I didn't change anything in the Settings.
I'm using the latest Eclipse Helios build.
Can anyone help me?