quando compilo il seguente codice mi da gli errori vesualizzati nell'allegato
qualcuno di voi sa dirmi dov'č che sbaglio?codice:import javax.swing.*; import java.awt.*; public class Application extends JFrame { public Application() { JLabel label = new JLabel("Welcome!"); label.setBorder(BorderFactory.createLineBorder(Color.red)); JLabel labelIcon = new JLabel(new ImageIcon("img.jpe")); labelIcon.setBorder(BorderFactory.createLineBorder(Color.blue)); JButton try = new JButton("TRY"); JPanel northPanel = new JPanel(); northPanel.setLayout(new GridLayout(1,0)); northPanel.setBorder(BorderFactory.createEmptyBorder(10,4,10,4)); northPanel.add(label); JPanel centralPanel = new JPanel(); centralPanel.setLayout(new BorderLayout()); centralPanel.setBorder(BorderFactory.createEmptyBorder(3,4,3,4)); centralPanel.add(BorderLayout.Center,labelIcon); JPanel southPanel = new JPanel(); southPanel.setLayout(new BorderLayout()); southPanel.setBorder(BorderFactory.createEmptyBorder(3,4,3,4)); southPanel.add(BorderLayout.CENTER,try); getContentPane().setLayout(new BorderLayout()); getContentPane().add(BorderLayout.NORTH,northPanel); getContentPane().add(BorderLayout.CENTER,centralPanel); getContentPane().add(BorderLayout.SOUTH,southPanel); pack(); setVisible(true); } public static void main (String argv[]) { Application ap = new Application(); } }
grazie

Rispondi quotando
