/** @throws IOException */ public void setting_panel() throws IOException { this.setTitle("Music World!!"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // the line that reads the image file // BufferedImage image = ImageIO.read(new File("icon.jpg")); // BufferedImage image = ImageIO.read(new File("C:/Users/Marium // Ahmad/work/P2P/GUI/ui/P2P/CT/icon.jpg")); this.setBounds(20, 20, 479, 483); // ImagePanel panel = new ImagePanel(new ImageIcon("C:/Users/Marium // Ahmad/work/P2P/GUI/ui/P2P/CT/background_image_music.jpg").getImage()); // ImagePanel panel = new ImagePanel(new ImageIcon("background_image_music.jpg").getImage()); /** * **************************************************************************************************************************************************** * Menu Bar * **************************************************************************************************************************************************** */ JMenuBar menuBar = new JMenuBar(); menuBar.setBackground(new Color(240, 240, 240)); setJMenuBar(menuBar); JMenu FileMenu = new JMenu("File"); FileMenu.setMnemonic('F'); menuBar.add(FileMenu); JMenuItem OpenMenuItem = new JMenuItem("Open..."); OpenMenuItem.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { JFileChooser chooser = new JFileChooser(); chooser.showOpenDialog(null); File file = chooser.getSelectedFile(); // file.getName().toLowerCase().endsWith(".mp3"); String filename = file.getName(); } }); FileMenu.add(OpenMenuItem); JMenuItem CloseMenu = new JMenuItem("Close"); FileMenu.add(CloseMenu); JMenuItem RPIMenu = new JMenuItem("Recently played item"); FileMenu.add(RPIMenu); JMenuItem ExitMenu = new JMenuItem("Exit"); ExitMenu.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { System.exit(0); } }); FileMenu.add(ExitMenu); JMenu HelpMenu = new JMenu("Help"); HelpMenu.setMnemonic('H'); menuBar.add(HelpMenu); JMenuItem AboutMenu = new JMenuItem("About"); HelpMenu.add(AboutMenu); JMenuItem ContentsMenu = new JMenuItem("Help Contents"); HelpMenu.add(ContentsMenu); /* * ************************************************************************************************************************************************** */ contentPane = new JPanel(); contentPane.setBackground(new Color(240, 240, 240)); contentPane.setBorder(UIManager.getBorder("MenuBar.border")); setContentPane(contentPane); /** * *************************************************************************************************************************************************** * Adding genre list choice * **************************************************************************************************************************************************** */ /* * Setting Fonts */ Font SansSerif = new Font("SansSerif", Font.PLAIN, 14); contentPane.setFont(SansSerif); JPanel panel_2 = new JPanel(); contentPane.add(panel_2); textField_2 = new JTextField(); textField_2.setColumns(10); JLabel lblAlbum = new JLabel("Album"); lblAlbum.setFont(new Font("Showcard Gothic", Font.PLAIN, 11)); GroupLayout gl_panel_2 = new GroupLayout(panel_2); gl_panel_2.setHorizontalGroup( gl_panel_2 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_2 .createSequentialGroup() .addGroup( gl_panel_2 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_2 .createSequentialGroup() .addGap(45) .addComponent(lblAlbum)) .addGroup( gl_panel_2 .createSequentialGroup() .addGap(16) .addComponent( textField_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addContainerGap(17, Short.MAX_VALUE))); gl_panel_2.setVerticalGroup( gl_panel_2 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_2 .createSequentialGroup() .addGap(5) .addComponent( textField_2, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblAlbum))); panel_2.setLayout(gl_panel_2); JPanel panel_1 = new JPanel(); contentPane.add(panel_1); textField = new JTextField(); textField.setColumns(10); JLabel lblGenre = new JLabel("Genre"); lblGenre.setFont(new Font("Showcard Gothic", Font.PLAIN, 11)); textField_1 = new JTextField(); textField_1.setColumns(10); JLabel lblArtist = new JLabel("Artist"); lblArtist.setFont(new Font("Showcard Gothic", Font.PLAIN, 11)); GroupLayout gl_panel_1 = new GroupLayout(panel_1); gl_panel_1.setHorizontalGroup( gl_panel_1 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_1 .createSequentialGroup() .addGroup( gl_panel_1 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_1 .createSequentialGroup() .addGap(45) .addComponent(lblGenre)) .addGroup( gl_panel_1 .createSequentialGroup() .addGap(46) .addComponent(lblArtist)) .addGroup( gl_panel_1 .createSequentialGroup() .addGap(16) .addComponent( textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup( gl_panel_1 .createSequentialGroup() .addGap(16) .addComponent( textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addContainerGap(17, Short.MAX_VALUE))); gl_panel_1.setVerticalGroup( gl_panel_1 .createParallelGroup(Alignment.LEADING) .addGroup( gl_panel_1 .createSequentialGroup() .addGap(5) .addComponent( textField, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(lblGenre) .addGap(5) .addComponent( textField_1, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblArtist))); panel_1.setLayout(gl_panel_1); // String genre = chooser.getSelectedItem(); // logger.debug(genre); // chooser.addItemListener((ItemListener) this); /* Event.itemStateChanged(ItemEvent e) // { String result = chooser.getSelectedItem(); myTextField.setText("Your Choice: " + result); logger.debug(result); //} */ /* * ************************************************************************************************************************************************** */ /** * ************************************************************************************************************************************************** * Adding Button * ***************************************************************************************************************************************** */ Component glue_2 = Box.createGlue(); contentPane.add(glue_2); Component glue_4 = Box.createGlue(); contentPane.add(glue_4); Component glue_5 = Box.createGlue(); contentPane.add(glue_5); Component glue_6 = Box.createGlue(); contentPane.add(glue_6); Component glue_7 = Box.createGlue(); contentPane.add(glue_7); txtTypeGenrealbumartistName = new JTextField("Enter Song"); contentPane.add(txtTypeGenrealbumartistName); txtTypeGenrealbumartistName.setSelectionColor(SystemColor.controlLtHighlight); txtTypeGenrealbumartistName.setPreferredSize(new Dimension(100, 20)); txtTypeGenrealbumartistName.setBackground(SystemColor.activeCaption); txtTypeGenrealbumartistName.setForeground(new Color(102, 0, 204)); JButton Pause = new JButton(); Pause.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // **********For pause Button } }); // **************This whole is for progress bar*********************************** // final LongTask task = new LongTask(); // int length = 0; // final JProgressBar progressBar = new JProgressBar(0,task.getLengthOfTask()); // progressBar.setValue(0); // progressBar.setStringPainted(true); // ********************************************************************************* JButton Play = new JButton(); Play.setAlignmentX(Component.RIGHT_ALIGNMENT); Play.setAlignmentY(Component.BOTTOM_ALIGNMENT); Play.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // To Do from the recommender system if (txtTypeGenrealbumartistName.getText().equals("Enter Song")) JOptionPane.showMessageDialog(null, "Enter something in the textbox to play"); else { String UserInput = txtTypeGenrealbumartistName.getText(); logger.debug(UserInput); // TO DO "UserInput to the recommender system // **********************OBSERVABLE***************************** try { Thread.sleep(500); } catch (InterruptedException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } // waiting for the input ObservableValue Observing_String = new ObservableValue(null); TextObserver Update_Value = new TextObserver(Observing_String); Observing_String.addObserver( Update_Value); /// *********************use as many observer as you want....If you // find difficulty just email me. // Debugging***************************************************************** // Observe observe = new Observe(); // ************************************************************************** /* * Creating a list for checking * Arrange the progressBar accordingly * */ String[] Check = new String[6]; Check[0] = "One"; // progressBar.setValue(2); Check[1] = "Two"; // progressBar.setValue(4); Check[2] = "Three"; // progressBar.setValue(6); Check[3] = "Four"; // progressBar.setValue(8); Check[4] = "Five"; // progressBar.setValue(10); Check[5] = "Six"; // logger.debug("here1"); for (int i = 0; i < Check.length; i++) { // logger.debug( Iter.next() ); Observing_String.setSong(Check[i]); /* * The updated value is shown in the text bars...here you will observe the same value as I took a single observer...rest of the thing is in email. */ textField.setText(Update_Value.GetValue()); textField_1.setText(Update_Value.GetValue()); textField_2.setText(Update_Value.GetValue()); try { Thread.sleep(2000); } catch (InterruptedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } // DEBUGGING******************************************************************This is // used when you run it via Observe.java /*observe.startEngine(); try { Thread.sleep(3000); } catch (InterruptedException Check) { Check.printStackTrace(); } observe.stopEngine();*/ // Debugging******************************************************************* } } }); // contentPane.add(progressBar); THE ADDITION OF PROGRESS BAR! // Play.setIcon(new ImageIcon("C:\\Users\\Marium // Ahmad\\work\\P2P\\GUI\\ui\\P2P\\CT\\Button-Play-icon.png")); contentPane.add(Play); JButton Stop = new JButton(); Stop.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { // *************For stop button } }); Component glue = Box.createGlue(); contentPane.add(glue); Stop.setAlignmentX(Component.RIGHT_ALIGNMENT); Stop.setAlignmentY(Component.TOP_ALIGNMENT); // Stop.setIcon(new ImageIcon("C:\\Users\\Marium // Ahmad\\work\\P2P\\GUI\\ui\\P2P\\CT\\Button-Stop-icon.png")); contentPane.add(Stop); Pause.setAlignmentX(Component.RIGHT_ALIGNMENT); Pause.setAlignmentY(Component.TOP_ALIGNMENT); // Pause.setIcon(new ImageIcon("C:\\Users\\Marium // Ahmad\\work\\P2P\\GUI\\ui\\P2P\\CT\\Button-Pause-icon.png")); contentPane.add(Pause); JButton Skip = new JButton(); Skip.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { // *****For the Skip button } }); Component glue_1 = Box.createGlue(); contentPane.add(glue_1); // Skip.setIcon(new ImageIcon("C:\\Users\\Marium // Ahmad\\work\\P2P\\GUI\\ui\\P2P\\CT\\button_fast_forward_right_next_skip_button_bak_icon_go_arrow.png")); contentPane.add(Skip); /** * ************************************************************************************************************************************************** * Message display * ************************************************************************************************************************************************** */ ScrollPane scrollPane = new ScrollPane(); scrollPane.setForeground(Color.WHITE); scrollPane.setFont(new Font("Arial", Font.PLAIN, 12)); scrollPane.setBackground(Color.WHITE); // panel.add(scrollPane, BorderLayout.CENTER); }
/** This is the main method for configuring the <it>MyScreenAbout</it>. */ public MyScreenAbout() { // constructor setSize(470, 600); setTitle("informació sobre el MAGNUS"); setResizable(false); Toolkit toolkit = Toolkit.getDefaultToolkit(); URL url = getClass().getResource("icon.png"); Image image = toolkit.getImage(url); setIconImage(image); ScrollPane scrollPane = new ScrollPane(ScrollPane.SCROLLBARS_NEVER); scrollPane.setSize(470, 148); scrollPane.setBackground(new Color(0, 128, 0)); Canvas canvas = new MyCanvasAbout(); canvas.setSize(470, 148); scrollPane.add(canvas); add(scrollPane, BorderLayout.NORTH); ScrollPane infoscroll = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED); infoscroll.setSize(470, 400); infoscroll.setBackground(new Color(255, 255, 255)); Panel info = new Panel(); info.setLayout(new GridLayout(56, 1)); infoscroll.add(info); Label ts1 = new Label("MAGNUS 0.1.1"); ts1.setFont(new Font("SansSerif", Font.BOLD, 10)); ts1.setForeground(new Color(0, 0, 0)); ts1.setBackground(new Color(255, 255, 255)); info.add(ts1); Label ts2 = new Label("http://magnusproject.wordpress.com"); ts2.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts2.setForeground(new Color(0, 0, 255)); ts2.setBackground(new Color(255, 255, 255)); info.add(ts2); Label ts3 = new Label(" "); ts3.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts3.setForeground(new Color(0, 0, 255)); ts3.setBackground(new Color(255, 255, 255)); info.add(ts3); Label ts4 = new Label("Alexandre Trilla Castelló"); ts4.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts4.setForeground(new Color(0, 0, 0)); ts4.setBackground(new Color(255, 255, 255)); info.add(ts4); Label ts5 = new Label(" http://www.salle.url.edu/~atrilla/"); ts5.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts5.setForeground(new Color(0, 0, 255)); ts5.setBackground(new Color(255, 255, 255)); info.add(ts5); Label ts7 = new Label("Departament d'Educació de la Generalitat de Catalunya"); ts7.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts7.setForeground(new Color(0, 0, 0)); ts7.setBackground(new Color(255, 255, 255)); info.add(ts7); Label ts8 = new Label(" http://www.xtec.cat"); ts8.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts8.setForeground(new Color(0, 0, 255)); ts8.setBackground(new Color(255, 255, 255)); info.add(ts8); Label ts9 = new Label("Universitat Ramon Llull La Salle Enginyeria de Telecomunicació"); ts9.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts9.setForeground(new Color(0, 0, 0)); ts9.setBackground(new Color(255, 255, 255)); info.add(ts9); Label ts10 = new Label(" http://www.salle.url.edu"); ts10.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts10.setForeground(new Color(0, 0, 255)); ts10.setBackground(new Color(255, 255, 255)); info.add(ts10); Label ts11 = new Label(" "); ts11.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts11.setForeground(new Color(0, 0, 0)); ts11.setBackground(new Color(255, 255, 255)); info.add(ts11); Label ts111 = new Label(" "); ts111.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts111.setForeground(new Color(0, 0, 255)); ts111.setBackground(new Color(255, 255, 255)); info.add(ts111); DesenvCanvas dc = new DesenvCanvas(); info.add(dc); Label ts17 = new Label("MAGNUS ha estat desenvolupat per Alexandre Trilla"); ts17.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts17.setForeground(new Color(0, 0, 0)); ts17.setBackground(new Color(255, 255, 255)); info.add(ts17); Label ts18 = new Label("pel Servei de Tecnologies per l'Aprenentatge i el"); ts18.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts18.setForeground(new Color(0, 0, 0)); ts18.setBackground(new Color(255, 255, 255)); info.add(ts18); Label ts19 = new Label("Coneixement del Departament d'Educació de la"); ts19.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts19.setForeground(new Color(0, 0, 0)); ts19.setBackground(new Color(255, 255, 255)); info.add(ts19); Label ts20 = new Label("Generalitat de Catalunya."); ts20.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts20.setForeground(new Color(0, 0, 0)); ts20.setBackground(new Color(255, 255, 255)); info.add(ts20); Label ts21 = new Label(" "); ts21.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts21.setForeground(new Color(0, 0, 0)); ts21.setBackground(new Color(255, 255, 255)); info.add(ts21); Label ts22 = new Label("Alhora, MAGNUS ha constituït el Projecte Final de"); ts22.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts22.setForeground(new Color(0, 0, 0)); ts22.setBackground(new Color(255, 255, 255)); info.add(ts22); Label ts23 = new Label("Carrera de l'autor, havent cursat d'Enginyeria"); ts23.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts23.setForeground(new Color(0, 0, 0)); ts23.setBackground(new Color(255, 255, 255)); info.add(ts23); Label ts24 = new Label("Superior de Telecomunicacions a la Universitat"); ts24.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts24.setForeground(new Color(0, 0, 0)); ts24.setBackground(new Color(255, 255, 255)); info.add(ts24); Label ts25 = new Label("Ramon Llull La Salle de Barcelona."); ts25.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts25.setForeground(new Color(0, 0, 0)); ts25.setBackground(new Color(255, 255, 255)); info.add(ts25); Label ts26 = new Label(" "); ts26.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts26.setForeground(new Color(0, 0, 0)); ts26.setBackground(new Color(255, 255, 255)); info.add(ts26); Label ts261 = new Label(" "); ts261.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts261.setForeground(new Color(0, 0, 0)); ts261.setBackground(new Color(255, 255, 255)); info.add(ts261); CredenCanvas cc = new CredenCanvas(); info.add(cc); Label ts12 = new Label("Aquest producte inclou programari desenvolupat per:"); ts12.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts12.setForeground(new Color(0, 0, 0)); ts12.setBackground(new Color(255, 255, 255)); info.add(ts12); Label ts121 = new Label(" "); ts121.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts121.setForeground(new Color(0, 0, 0)); ts121.setBackground(new Color(255, 255, 255)); info.add(ts121); Label ts13 = new Label("Sphinx-4"); ts13.setFont(new Font("SansSerif", Font.BOLD, 10)); ts13.setForeground(new Color(0, 0, 0)); ts13.setBackground(new Color(255, 255, 255)); info.add(ts13); Label ts14 = new Label("Carnegie Mellon University"); ts14.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts14.setForeground(new Color(0, 0, 0)); ts14.setBackground(new Color(255, 255, 255)); info.add(ts14); Label ts142 = new Label(" http://cmusphinx.sourceforge.net/sphinx4/"); ts142.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts142.setForeground(new Color(0, 0, 255)); ts142.setBackground(new Color(255, 255, 255)); info.add(ts142); Label ts141 = new Label(" "); ts141.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts141.setForeground(new Color(0, 0, 0)); ts141.setBackground(new Color(255, 255, 255)); info.add(ts141); Label ts15 = new Label("Jdom"); ts15.setFont(new Font("SansSerif", Font.BOLD, 10)); ts15.setForeground(new Color(0, 0, 0)); ts15.setBackground(new Color(255, 255, 255)); info.add(ts15); Label ts16 = new Label("The JDOM Project"); ts16.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts16.setForeground(new Color(0, 0, 0)); ts16.setBackground(new Color(255, 255, 255)); info.add(ts16); Label ts162 = new Label(" http://www.jdom.org"); ts162.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts162.setForeground(new Color(0, 0, 255)); ts162.setBackground(new Color(255, 255, 255)); info.add(ts162); Label ts161 = new Label(" "); ts161.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts161.setForeground(new Color(0, 0, 0)); ts161.setBackground(new Color(255, 255, 255)); info.add(ts161); Label ts163 = new Label(" "); ts163.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts163.setForeground(new Color(0, 0, 0)); ts163.setBackground(new Color(255, 255, 255)); info.add(ts163); LicCanvas lc = new LicCanvas(); info.add(lc); Label ts64 = new Label("Copyright (C) 2007 Alexandre Trilla &"); ts64.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts64.setForeground(new Color(0, 0, 0)); ts64.setBackground(new Color(255, 255, 255)); info.add(ts64); Label ts65 = new Label("Departament d'Educació de la Generalitat de Catalunya &"); ts65.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts65.setForeground(new Color(0, 0, 0)); ts65.setBackground(new Color(255, 255, 255)); info.add(ts65); Label ts66 = new Label("Universitat Ramon Llull La Salle Enginyeria de Telecomunicació"); ts66.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts66.setForeground(new Color(0, 0, 0)); ts66.setBackground(new Color(255, 255, 255)); info.add(ts66); Label ts67 = new Label(" "); ts67.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts67.setForeground(new Color(0, 0, 0)); ts67.setBackground(new Color(255, 255, 255)); info.add(ts67); Label ts68 = new Label("Aquest programa és lliure. Podeu distribuir-lo i/o modificar-"); ts68.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts68.setForeground(new Color(0, 0, 0)); ts68.setBackground(new Color(255, 255, 255)); info.add(ts68); Label ts69 = new Label("lo conforme a les disposicions de la Llicència Pública General"); ts69.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts69.setForeground(new Color(0, 0, 0)); ts69.setBackground(new Color(255, 255, 255)); info.add(ts69); Label ts70 = new Label("de GNU (GPL), publicada per la Free Software Foundation, ja"); ts70.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts70.setForeground(new Color(0, 0, 0)); ts70.setBackground(new Color(255, 255, 255)); info.add(ts70); Label ts71 = new Label("sigui la versió 3 de la llicència o qualsevol versió posterior."); ts71.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts71.setForeground(new Color(0, 0, 0)); ts71.setBackground(new Color(255, 255, 255)); info.add(ts71); Label ts711 = new Label(" "); ts711.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts711.setForeground(new Color(0, 0, 0)); ts711.setBackground(new Color(255, 255, 255)); info.add(ts711); Label ts72 = new Label("Aquest programa es distribueix amb la intenció de resultar"); ts72.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts72.setForeground(new Color(0, 0, 0)); ts72.setBackground(new Color(255, 255, 255)); info.add(ts72); Label ts73 = new Label("útil, però SENSE CAP GARANTIA, fins i tot sense la garantia"); ts73.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts73.setForeground(new Color(0, 0, 0)); ts73.setBackground(new Color(255, 255, 255)); info.add(ts73); Label ts74 = new Label("implícita de COMERCIABILITAT o CONVENIÈNCIA PER A UN"); ts74.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts74.setForeground(new Color(0, 0, 0)); ts74.setBackground(new Color(255, 255, 255)); info.add(ts74); Label ts75 = new Label("PROPÒSIT PARTICULAR. Per a més detalls, vegeu la Llicència"); ts75.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts75.setForeground(new Color(0, 0, 0)); ts75.setBackground(new Color(255, 255, 255)); info.add(ts75); Label ts76 = new Label("Pública General de GNU."); ts76.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts76.setForeground(new Color(0, 0, 0)); ts76.setBackground(new Color(255, 255, 255)); info.add(ts76); Label ts77 = new Label(" "); ts77.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts77.setForeground(new Color(0, 0, 0)); ts77.setBackground(new Color(255, 255, 255)); info.add(ts77); Label ts771 = new Label(" "); ts771.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts771.setForeground(new Color(0, 0, 0)); ts771.setBackground(new Color(255, 255, 255)); info.add(ts771); SupCanvas supc = new SupCanvas(); info.add(supc); Label ts1234 = new Label("Desenvolupat en col·laboració amb Enginyeria i"); ts1234.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts1234.setForeground(new Color(0, 0, 0)); ts1234.setBackground(new Color(255, 255, 255)); info.add(ts1234); Label ts12345 = new Label("Arquitectura La Salle (Universitat Ramon Llull)"); ts12345.setFont(new Font("SansSerif", Font.PLAIN, 10)); ts12345.setForeground(new Color(0, 0, 0)); ts12345.setBackground(new Color(255, 255, 255)); info.add(ts12345); SalleCanvas sallec = new SalleCanvas(); // info.add(sallec); add(sallec, BorderLayout.SOUTH); add(infoscroll, BorderLayout.CENTER); addWindowListener( new WindowAdapter() { /** * This method catches the closing event and react accordingly. * * @param e WindowEvent: the window closing event. */ public void windowClosing(WindowEvent e) { setVisible(false); } }); }