Olá.
Criei um PopUp que não está rodando.
Alguém saberia me dizer por que.
Está dando problema no método main.
Eis o meu código:
package TabelasB;
import javax.swing.WindowConstants;
import java.awt.*;
import java.awt.event.ActionEvent;
/**
- This code was 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 www.cloudgarden.com 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 PopUp extends javax.swing.JFrame {
/**
* Auto-generated main method to display this JFrame
* @param PopUp
*/
public static void main(String[] args, Component PopUp) {
PopUp inst = new PopUp("Opções de Consulta");
Button b=new Button("Clique");
PopupMenu p= new PopupMenu("PopUp");
MenuItem s= new MenuItem("Save");
MenuItem ld= new MenuItem("Load");
b.addActionListener(null);
inst.add(inst,BorderLayout.CENTER);
p.add(s);
p.add(ld);
inst.add(p);
inst.setVisible(true);
}
private void actionPerformed(ActionEvent evt, PopupMenu p, Component b){
p.show(b,10,10);
}
public PopUp() {
super();
initGUI();
}
/**
* @param string
*/
public PopUp(String string) {
// TODO Auto-generated constructor stub
}
private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
pack();
setSize(400, 300);
} catch (Exception e) {
e.printStackTrace();
}
}
}