Ho creato un programmino con jframe nel quale vengono aperti dei JTabbedPane per visualizzare le cose che mi servono
Vorrei mettere un'immagine di sfondo alla mia finestra che verrà coperta nel momento in cui attraverso il menu aprirò un nuovo Tabcodice:public class mainprogram extends JFrame { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { mainprogram inst = new mainprogram(); inst.setLocationRelativeTo(null); inst.setVisible(true); } }); } public mainprogram() { super("MIOPROGRAMMA"); initGUI(); } private void initGUI() { { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } { JPanel topPanel = new JPanel(); topPanel.setLayout( new BorderLayout() ); getContentPane().add( topPanel ); tabbedPane = new CloseableTabbedPane(); topPanel.add( tabbedPane, BorderLayout.CENTER ); } this.setSize(750, 600); { { jMenuBar1 = new JMenuBar(); setJMenuBar(jMenuBar1); { jMenu3 = new JMenu(); jMenuBar1.add(jMenu3); jMenu3.setText("File"); { newFileMenuItem = new JMenuItem(); Menu3.add(newFileMenuItem); newFileMenuItem.setText("New project"); newFileMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { tabbedPane.addTab( name,new project() ); tabbedPane.setEnabled(true); } }); } }
tabbedPane.addTab( name,new project() );
come fare? dove devo aggiungere il codice? Grazie

Rispondi quotando

