Ich verzweifel...
Bei mir wir nie ein jMenu angezeigt.
Gehe wie in den Tutorials vor...
Im Builder und in der Vorschau ist es zu sehen - beim Ausführen nicht.
Was mache ich falsch ?
Bei mir wir nie ein jMenu angezeigt.
Gehe wie in den Tutorials vor...
Im Builder und in der Vorschau ist es zu sehen - beim Ausführen nicht.
Was mache ich falsch ?
Java:
package main;
import java.awt.BorderLayout;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.LayoutStyle;
import javax.swing.WindowConstants;
import org.jdesktop.application.Application;
import javax.swing.SwingUtilities;
/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit [url=http://www.cloudgarden.com]Cloud Garden (Java Resources)[/url] for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class NewJFrame extends javax.swing.JFrame {
private JButton jButton1;
private JMenu jMenu2;
private JMenu jMenu1;
private JMenuBar jMenuBar1;
/**
* Auto-generated main method to display this JFrame
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
NewJFrame inst = new NewJFrame();
inst.setLocationRelativeTo(null);
inst.setVisible(true);
}
});
}
public NewJFrame() {
super();
initGUI();
}
private void initGUI() {
try {
GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
getContentPane().setLayout(thisLayout);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
{
jMenuBar1 = new JMenuBar();
setJMenuBar(jMenuBar1);
{
jMenu1 = new JMenu();
jMenuBar1.add(jMenu1);
jMenu1.setName("jMenu1");
{
jMenu2 = new JMenu();
jMenu1.add(jMenu2);
jMenu2.setName("jMenu2");
}
}
}
{
jButton1 = new JButton();
jButton1.setName("jButton1");
}
thisLayout.setVerticalGroup(thisLayout.createSequentialGroup()
.addContainerGap(121, 121)
.addComponent(jButton1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
.addContainerGap(89, Short.MAX_VALUE));
thisLayout.setHorizontalGroup(thisLayout.createSequentialGroup()
.addContainerGap(29, 29)
.addComponent(jButton1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
.addContainerGap(282, Short.MAX_VALUE));
pack();
setSize(400, 300);
Application.getInstance().getContext().getResourceMap(getClass()).injectComponents(getContentPane());
} catch (Exception e) {
//add your error handling code here
e.printStackTrace();
}
}
}