Scrivo qui di seguito Prova.java con non posso caricare il file perchè accetta solo le immagini:
package gioco;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import java.awt.Color;
import java.awt.event.ActionListener;
public class Prova extends JFrame {
private JPanel contentPane;
private final Action action = new SwingAction();
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Prova frame = new Prova();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Prova() {
setTitle("Craftmine");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 800, 600);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu mnNewMenu = new JMenu("File");
menuBar.add(mnNewMenu);
JRadioButtonMenuItem rdbtnmntmNewRadioItem = new JRadioButtonMenuItem("Nuova Partita");
mnNewMenu.add(rdbtnmntmNewRadioItem);
JRadioButtonMenuItem rdbtnmntmNewRadioItem_1 = new JRadioButtonMenuItem("Carica Partita");
mnNewMenu.add(rdbtnmntmNewRadioItem_1);
JRadioButtonMenuItem rdbtnmntmNewRadioItem_2 = new JRadioButtonMenuItem("Salva");
mnNewMenu.add(rdbtnmntmNewRadioItem_2);
JMenu mnNewMenu_1 = new JMenu("Chi siamo");
menuBar.add(mnNewMenu_1);
JRadioButtonMenuItem rdbtnmntmNewRadioItem_4 = new JRadioButtonMenuItem("Mastroking");
rdbtnmntmNewRadioItem_4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if(arg0.equals("Mastroking"))
}
});
rdbtnmntmNewRadioItem_4.setForeground(new Color(0, 0, 0));
mnNewMenu_1.add(rdbtnmntmNewRadioItem_4);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}
private class SwingAction extends AbstractAction {
public SwingAction() {
putValue(NAME, "SwingAction");
putValue(SHORT_DESCRIPTION, "Some short description");
}
public void actionPerformed(ActionEvent e) {
}
}
}