Salve, volevo creare un semplice programmino, basato su un JDesktopPane, e le relative JInternalFrames, e posizionare nella parte bassa della finestra una JToolBar, a mo' di "Sistema Operativo".
Ma, purtroppo quest'ultima non mi viene visualizzata... Qualcuno saprebbe illustrarmi il problema?
Posto il sorgente:
codice:package myvirtualdesktop; import javax.swing.*; import java.awt.event.*; import java.awt.*; public class MyVirtualDesktop { static JFrame window = new JFrame(); //-------------------------------------------------------------------------// public static void main(String[] args) { //VIRTUAL DESKTOP JDesktopPane desktop = new JDesktopPane(); desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); //First Internal Frame JInternalFrame firsintframe = new JInternalFrame("Benvenuto su MyVirtualDesktop"); firsintframe.setVisible(true); firsintframe.setSize(350, 400); firsintframe.setClosable(true); firsintframe.setIconifiable(true); String presentation = "<html>\n" + "<h2>Benvenuto in MyVirtualDesktop!</h2>\n" + " \n" + "Grazie a questo software open source, avrai la possibilità di usufruire di un desktop virtuale completo di:\n" + "<ul>\n"+ "[*]\n" + "[*]\n" + "[*]\n" + " \n" + "[/list]\n"; JTextArea htmlcode = new JTextArea(); htmlcode.setText(presentation); JLabel htmllabel = new JLabel(presentation); firsintframe.add(htmllabel, BorderLayout.NORTH); desktop.add(firsintframe); //TOOLBAR JToolBar toolbar = new JToolBar(); ImageIcon windowico = new ImageIcon("C:/Users/Th3Evolution/Documents/NetBeansProjects/Work/images"); JButton newWindow = new JButton(windowico); toolbar.add(newWindow); //WINDOW SETTINGS; window.setName("MyVirtualDesktop No-Version"); window.setSize(1245, 740); window.setVisible(true); window.setResizable(false); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.add(toolbar); window.setContentPane(desktop); } }

Rispondi quotando

