package Frame; import javax.swing.*; /** Questo programma visualizza un frame con un'immagine e un'etichetta di testo */ public class FrameTest { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel iconLabel = new JLabel(new ImageIcon("fda2.jpg")); JLabel textLabel = new JLabel("Fabrizio De Andre'"); // pannello che contiene i componenti dell'interfaccia utente JPanel panel = new JPanel(); panel.add(iconLabel); panel.add(textLabel); frame.setContentPane(panel); frame.pack(); frame.setVisible(true); } }