@Override public void setFont(Font font) { FontMetrics fm = getFontMetrics(font); lineHeight = fm.getHeight(); charWidth = fm.charWidth('0'); super.setFont(font); }
/** * Sets the font property. * * @param font the new font */ public void setFont(Font font) { super.setFont(font); if (dayChooser != null) { dayChooser.setFont(font); monthChooser.setFont(font); yearChooser.setFont(font); } }
public TestHTML() { int d = (Frame.getFrames().length == 0) ? JFrame.EXIT_ON_CLOSE : JFrame.DISPOSE_ON_CLOSE; JPanel pan = new JPanel(); pan.setLayout(new BorderLayout(GAP, GAP - 4)); pan.setBorder(new EmptyBorder(GAP, GAP, GAP, GAP)); pan.setBackground(COL); pan.setFont(font); lab = new JLabel(MSG); // , SwingConstants.CENTER); lab.setName("title"); lab.setFont(new Font("Serif", 3, 16)); // lab.setForeground(Color.black); pan.add(lab, "North"); text = new JTextArea("JTextArea\n"); text.setName("area"); text.setLineWrap(true); text.setFont(font); JScrollPane scr1 = new JScrollPane(text); scr1.setPreferredSize(new Dimension(300, 500)); pan.add(scr1, "Center"); html = new JEditorPane(); html.setContentType("text/html"); html.setEditable(false); html.addMouseListener(this); html.addMouseMotionListener(this); JScrollPane scr2 = new JScrollPane(html); scr2.setPreferredSize(new Dimension(350, 500)); pan.add(scr2, "East"); but = new JButton("Copy text from JTextArea to JEditorPane"); but.addActionListener(this); pan.add(but, "South"); frm = new JFrame(MSG); frm.setContentPane(pan); frm.setDefaultCloseOperation(d); frm.setLocation(100, 150); frm.pack(); frm.setVisible(true); }
/** * Component initialization. * * @throws java.lang.Exception */ private void jbInit() throws Exception { contentPane = (JPanel) getContentPane(); contentPane.setLayout(null); this.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); setSize(new Dimension(400, 621)); setTitle("实时通讯模块测试程序"); jButton1.setBounds(new Rectangle(11, 412, 82, 26)); jButton1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton1.setText("召测接口"); jButton1.addActionListener(new RealTimeTestFrame_jButton1_actionAdapter(this)); jButton2.setBounds(new Rectangle(10, 366, 83, 26)); jButton2.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton2.setText("创建对象"); jButton2.addActionListener(new RealTimeTestFrame_jButton2_actionAdapter(this)); jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel1.setText("接入IP:"); jLabel1.setBounds(new Rectangle(23, 22, 63, 16)); jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel2.setText("接入端口:"); jLabel2.setBounds(new Rectangle(23, 67, 63, 16)); jTextField1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jTextField1.setText("172.19.74.13"); txt_port.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_port.setText("3000"); txt_port.setBounds(new Rectangle(84, 64, 88, 22)); jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel3.setText("AppID:"); jLabel3.setBounds(new Rectangle(23, 113, 63, 16)); contentPane.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel4.setText("ZDLJDZ:"); jLabel4.setBounds(new Rectangle(23, 158, 63, 16)); jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel5.setText("规约号:"); jLabel5.setBounds(new Rectangle(23, 186, 63, 16)); jLabel6.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel6.setText("发送内容:"); jLabel6.setBounds(new Rectangle(23, 333, 63, 16)); jLabel7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel7.setText("通讯方式:"); jLabel7.setBounds(new Rectangle(21, 219, 63, 16)); txt_AppID.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_AppID.setText("25"); txt_AppID.setBounds(new Rectangle(84, 110, 83, 22)); txt_zdljdz.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_zdljdz.setText("91010022"); txt_zdljdz.setBounds(new Rectangle(84, 155, 88, 22)); txt_gyh.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_gyh.setText("100"); txt_gyh.setBounds(new Rectangle(84, 183, 63, 22)); txt_txfs.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_txfs.setText("40"); txt_txfs.setBounds(new Rectangle(84, 218, 63, 22)); jTextField7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_ip.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); InetAddress localhost = java.net.InetAddress.getLocalHost(); String hostIP = localhost.getHostAddress(); txt_ip.setText(hostIP); txt_ip.setBounds(new Rectangle(84, 19, 159, 22)); txt_content.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_content.setText("6000000100111107"); txt_content.setBounds(new Rectangle(84, 330, 298, 22)); txt_content.addActionListener(new RealTimeTestFrame_txt_content_actionAdapter(this)); jButton3.setBounds(new Rectangle(200, 412, 89, 26)); jButton3.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton3.setText("发送短信"); jButton3.addActionListener(new RealTimeTestFrame_jButton3_actionAdapter(this)); jButton4.setBounds(new Rectangle(295, 366, 96, 26)); jButton4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton4.setText("自定义命令"); jButton4.addActionListener(new RealTimeTestFrame_jButton4_actionAdapter(this)); lab_yxj.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); lab_yxj.setText("优先级:"); lab_yxj.setBounds(new Rectangle(23, 287, 61, 16)); txt_gnm.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_gnm.setText("0D"); txt_gnm.setBounds(new Rectangle(84, 251, 63, 22)); jLabel9.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel9.setText("手机号码:"); jLabel9.setBounds(new Rectangle(190, 67, 67, 16)); txt_sjhm.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_sjhm.setText("13800571505"); txt_sjhm.setBounds(new Rectangle(250, 64, 111, 22)); jLabel10.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel10.setText("命令序号:"); jLabel10.setBounds(new Rectangle(190, 112, 73, 16)); txt_mlxh.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_mlxh.setText("1"); txt_mlxh.setBounds(new Rectangle(250, 109, 110, 22)); jButton5.setBounds(new Rectangle(105, 366, 83, 26)); jButton5.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton5.setText("连接"); jButton5.addActionListener(new RealTimeTestFrame_jButton5_actionAdapter(this)); jButton6.setBounds(new Rectangle(200, 366, 83, 26)); jButton6.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton6.setText("断开连接"); jButton6.addActionListener(new RealTimeTestFrame_jButton6_actionAdapter(this)); jLabel11.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel11.setText("终端逻辑地址:"); jLabel11.setBounds(new Rectangle(164, 199, 87, 16)); txt_listterminal.setText("12041234"); txt_listterminal.setBounds(new Rectangle(252, 196, 130, 22)); jButton8.setBounds(new Rectangle(170, 248, 90, 26)); jButton8.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton8.setText("加入队列"); jButton8.addActionListener(new RealTimeTestFrame_jButton8_actionAdapter(this)); jButton9.setBounds(new Rectangle(283, 248, 85, 26)); jButton9.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton9.setText("在线状态"); jButton9.addActionListener(new RealTimeTestFrame_jButton9_actionAdapter(this)); memo1.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); memo1.setToolTipText(""); memo1.setEditable(false); memo1.setLineWrap(true); memo1.setWrapStyleWord(true); memo1.setBounds(new Rectangle(17, 451, 361, 154)); jButton7.setBounds(new Rectangle(226, 289, 92, 26)); jButton7.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton7.setText("设置掉线"); jButton7.addActionListener(new RealTimeTestFrame_jButton7_actionAdapter(this)); jButton10.setBounds(new Rectangle(192, 155, 90, 23)); jButton10.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton10.setText("手工建档"); jButton10.addActionListener(new RealTimeTestFrame_jButton10_actionAdapter(this)); jLabel12.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jLabel12.setText("功能码:"); jLabel12.setBounds(new Rectangle(23, 254, 61, 16)); txt_yxj.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); txt_yxj.setText("08"); txt_yxj.setBounds(new Rectangle(84, 283, 63, 22)); jButton11.setBounds(new Rectangle(105, 412, 82, 26)); jButton11.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton11.setActionCommand(""); jButton11.setText("获取结果"); jButton11.addActionListener(new RealTimeTestFrame_jButton11_actionAdapter(this)); jButton12.setBounds(new Rectangle(301, 412, 87, 26)); jButton12.setFont(new java.awt.Font("宋体", Font.PLAIN, 12)); jButton12.setText("批量测试"); jButton12.addActionListener(new RealTimeTestFrame_jButton12_actionAdapter(this)); contentPane.add(jLabel1); contentPane.add(jLabel2); contentPane.add(txt_port); contentPane.add(jLabel3); contentPane.add(jLabel4); contentPane.add(jTextField1); contentPane.add(txt_AppID); contentPane.add(txt_zdljdz); contentPane.add(jTextField7); contentPane.add(txt_ip); contentPane.add(txt_content); contentPane.add(jLabel6); contentPane.add(jLabel9); contentPane.add(txt_sjhm); contentPane.add(jLabel10); contentPane.add(txt_mlxh); contentPane.add(txt_listterminal); contentPane.add(jLabel11); contentPane.add(jButton8); contentPane.add(jButton9); contentPane.add(memo1); contentPane.add(jButton7); contentPane.add(jButton10); contentPane.add(txt_gnm); contentPane.add(txt_txfs); contentPane.add(txt_gyh); contentPane.add(jLabel5); contentPane.add(jLabel7); contentPane.add(jLabel12); contentPane.add(lab_yxj); contentPane.add(txt_yxj); contentPane.add(jButton2); contentPane.add(jButton5); contentPane.add(jButton6); contentPane.add(jButton4); contentPane.add(jButton1); contentPane.add(jButton11); contentPane.add(jButton3); contentPane.add(jButton12); }
/** * Initialize frame * * @throws java.lang.Exception */ private void initializeModulesFrame() throws Exception { // frame initialization this.setFont(new java.awt.Font("Arial", 0, 11)); this.setIconImage( Toolkit.getDefaultToolkit() .getImage( this.getClass().getResource("/keel/GraphInterKeel/resources/ico/logo/logo.gif"))); this.setSize(new Dimension(640, 480)); this.setTitle("Keel"); this.setResizable(false); // Create panel contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(null); // panel background fondo.setText(""); fondo.setBounds(new Rectangle(0, 0, 640, 480)); fondo.setFont(new java.awt.Font("Arial", 0, 11)); fondo.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/fondo.gif"))); exit.setText("Exit KEEL"); exit.setBounds(new Rectangle(294, 327, 129, 36)); exit.setFont(new java.awt.Font("Arial", 0, 11)); // labels associated to buttons labelSalir.setFont(new java.awt.Font("Arial", 1, 18)); labelSalir.setForeground(Color.white); labelSalir.setText("Exit KEEL"); labelSalir.setBounds(new Rectangle(40, 412, 595, 27)); labelSalir.setVisible(false); labelBack.setFont(new java.awt.Font("Arial", 1, 18)); labelBack.setForeground(Color.white); labelBack.setText("Back to Keel Suite Menu"); labelBack.setBounds(new Rectangle(40, 412, 595, 27)); labelBack.setVisible(false); labelLQD.setFont(new java.awt.Font("Arial", 1, 18)); labelLQD.setForeground(Color.white); labelLQD.setText("Experiments Design with Low Quality Data"); labelLQD.setBounds(new Rectangle(40, 412, 465, 27)); labelLQD.setVisible(false); labelImbalance.setFont(new java.awt.Font("Arial", 1, 18)); labelImbalance.setForeground(Color.white); labelImbalance.setText("Experiments with Imbalanced Datasets"); labelImbalance.setBounds(new Rectangle(40, 412, 465, 27)); labelImbalance.setVisible(false); labelNonParametric.setFont(new java.awt.Font("Arial", 1, 18)); labelNonParametric.setForeground(Color.white); labelNonParametric.setText("Non-Parametric Statistical Analysis"); labelNonParametric.setBounds(new Rectangle(40, 412, 465, 27)); labelNonParametric.setVisible(false); labelSSL.setFont(new java.awt.Font("Arial", 1, 18)); labelSSL.setForeground(Color.white); labelSSL.setText("Semi-Supervised Learning"); labelSSL.setBounds(new Rectangle(40, 412, 465, 27)); labelSSL.setVisible(false); labelMil.setFont(new java.awt.Font("Arial", 1, 17)); labelMil.setForeground(Color.white); labelMil.setText("Experiments with Multiple Instance Learning"); labelMil.setBounds(new Rectangle(40, 412, 465, 27)); labelMil.setVisible(false); contentPane.setFont(new java.awt.Font("Arial", 0, 11)); keel.setText(""); keel.setBounds(new Rectangle(160, 13, 336, 33)); keel.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mod.png"))); logotipo.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/logotipo.png"))); logotipo.setBounds(new Rectangle(550, 13, 65, 43)); logotipo.addMouseListener(new FrameModules_logotipo_mouseAdapter(this)); logotipoSoft.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/Software.png"))); logotipoSoft.setBounds(new Rectangle(30, 13, 75, 43)); logotipoSoft.addMouseListener(new FrameModules_logotipoSoft_mouseAdapter(this)); barraExit.setBounds(new Rectangle(0, 401, 751, 50)); barraExit.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/exit.png"))); accionExit.setText("jLabel2"); accionExit.setBounds(new Rectangle(536, 409, 94, 38)); accionExit.addMouseListener(new FrameModules_accionExit_mouseAdapter(this)); back.setBounds(new Rectangle(406, 409, 110, 38)); back.addMouseListener(new FrameModules_back_mouseAdapter(this)); // lqd.setBounds(new Rectangle(50, 140, 244, 40)); lqd.setBounds(new Rectangle(50, 120, 244, 40)); lqd.addMouseListener(new Frame_lqd_mouseAdapter(this)); // imbalance.setBounds(new Rectangle(50, 200, 264, 38)); imbalance.setBounds(new Rectangle(50, 180, 264, 38)); imbalance.addMouseListener(new Frame_imbalance_mouseAdapter(this)); // nonParametric.setBounds(new Rectangle(50, 260, 400, 42)); nonParametric.setBounds(new Rectangle(50, 240, 400, 42)); nonParametric.addMouseListener(new Frame_nonParametric_mouseAdapter(this)); SSL.setBounds(new Rectangle(50, 300, 400, 42)); SSL.addMouseListener(new Frame_SSL_mouseAdapter(this)); // mil.setBounds(new Rectangle(50, 320, 400, 42)); mil.setBounds(new Rectangle(50, 360, 400, 42)); mil.addMouseListener(new Frame_mil_mouseAdapter(this)); lqd.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/lqd.png"))); imbalance.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/imbalance.png"))); nonParametric.setIcon( new ImageIcon( this.getClass() .getResource("/keel/GraphInterKeel/resources/imag/menu/nonParametric.png"))); SSL.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/SSL.png"))); mil.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/mil.png"))); back.setIcon( new ImageIcon( this.getClass().getResource("/keel/GraphInterKeel/resources/imag/menu/back.png"))); contentPane.add(back, null); contentPane.add(labelBack, null); contentPane.add(labelSalir, null); contentPane.add(labelLQD2, null); contentPane.add(labelLQD, null); contentPane.add(labelImbalance, null); contentPane.add(labelNonParametric, null); contentPane.add(labelSSL, null); contentPane.add(labelMil, null); // contentPane.add(lqd); contentPane.add(mil); contentPane.add(imbalance); contentPane.add(nonParametric); contentPane.add(SSL); contentPane.add(keel); contentPane.add(logotipo); contentPane.add(logotipoSoft); contentPane.add(barraExit); contentPane.add(fondo, null); contentPane.add(accionExit); }
private void flushWeekAndDayPanal(Calendar c) { // c.set c.set(Calendar.DAY_OF_MONTH, 1); c.setFirstDayOfWeek(0); int firstdayofWeek = c.get(Calendar.DAY_OF_WEEK); int lastdayofWeek = c.getActualMaximum(Calendar.DAY_OF_MONTH); String colname[] = {"日", "一", "二", "三", "四", "五", "六"}; int today = getNowCalendar().get(Calendar.DAY_OF_MONTH); // 璁剧疆鍥哄畾瀛椾綋锛屼互鍏嶈皟鐢ㄧ幆澧冩敼鍙樺奖鍝嶇晫闈㈢編瑙� dayPanel.setFont(new java.awt.Font("寰蒋闆呴粦", java.awt.Font.PLAIN, 12)); dayPanel.setLayout(new GridBagLayout()); dayPanel.setBackground(palletTableColor); JLabel cell; for (int i = 0; i < 7; i++) { cell = new JLabel(colname[i]); cell.setHorizontalAlignment(JLabel.CENTER); cell.setPreferredSize(new Dimension(25, 25)); if (i == 0 || i == 6) { cell.setForeground(weekendFontColor); } else { cell.setForeground(weekFontColor); } dayPanel.add( cell, new GridBagConstraints( i, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } int actionCommandId = 1; for (int i = 0; i < 6; i++) { for (int j = 0; j < 7; j++) { JButton numberButton = daysButton[i][j]; actionCommandId = Integer.parseInt(numberButton.getActionCommand()); if (actionCommandId == today) { numberButton.setBackground(todayBtnColor); } if ((actionCommandId + firstdayofWeek - 2) % 7 == 6 || (actionCommandId + firstdayofWeek - 2) % 7 == 0) { numberButton.setForeground(weekendFontColor); } else { numberButton.setForeground(dateFontColor); } if (actionCommandId <= lastdayofWeek) { int y = 0; if ((firstdayofWeek - 1) <= (j + firstdayofWeek - 1) % 7) { y = i + 1; } else { y = i + 2; } dayPanel.add( numberButton, new GridBagConstraints( (j + firstdayofWeek - 1) % 7, y, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } } } }
@SuppressWarnings("serial") private void initGUI() { try { setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); this.setTitle("Overzicht"); this.setVisible(true); { lStart = new JLabel(); getContentPane().add(lStart); lStart.setText("Overzicht"); lStart.setHorizontalAlignment(SwingConstants.CENTER); lStart.setBackground(new java.awt.Color(54, 190, 54)); lStart.setFont(new java.awt.Font("Arial", 1, 36)); lStart.setForeground(new java.awt.Color(0, 128, 64)); lStart.setOpaque(true); lStart.setBounds(0, 0, 336, 49); } { pInzet = new JPanel(); getContentPane().add(pInzet); pInzet.setBorder( BorderFactory.createTitledBorder( null, "Selectie", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 11))); pInzet.setLayout(null); pInzet.setBounds(14, 63, 308, 105); pInzet.setFont(new java.awt.Font("Tahoma", 1, 12)); { lMin = new JLabel(); pInzet.add(lMin); lMin.setText("Speler"); lMin.setFont(new java.awt.Font("Arial", 0, 12)); lMin.setBounds(17, 59, 62, 27); } { lMax = new JLabel(); pInzet.add(lMax); lMax.setText("Spelronde"); lMax.setFont(new java.awt.Font("Arial", 0, 12)); lMax.setBounds(17, 26, 62, 25); } // Combo voor Spelrondes. Deze wordt eerst geladen. Na selectie // wordt de speler gevuld. { oc = new OverzichtController(this); String[] rondes = oc.GeefSpelrondes(); ComboBoxModel cbSpelRondeModel = new DefaultComboBoxModel(rondes); cbSpelRonde = new JComboBox(); pInzet.add(cbSpelRonde); cbSpelRonde.setModel(cbSpelRondeModel); cbSpelRonde.setBounds(91, 29, 156, 21); cbSpelRonde.setToolTipText("Maak een keuze uit de gespeelde speelronden."); } { bStart = new JButton(); getContentPane().add(bStart); bStart.setText("Sluiten"); bStart.setFont(new java.awt.Font("Arial", 0, 12)); bStart.setBounds(196, 303, 75, 23); bStart.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent evt) { bStartActionPerformed(evt); } }); } } pack(); this.setSize(352, 364); } catch (Exception e) { e.printStackTrace(); } } // private void initGUI()
public Reflexology2() { frame.setSize(615, 455); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("Reflexology 2.0"); frame.setResizable(false); frame2.setSize(600, 475); frame2.setLocationRelativeTo(null); frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame2.setTitle("Reflexology 2.0"); frame2.setResizable(false); frame3.setSize(600, 475); frame3.setLocationRelativeTo(null); frame3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame3.setTitle("Reflexology Survey"); frame3.setResizable(false); button1 = new JButton("Accept"); button2 = new JButton("Decline"); // movingButton = new JButton("Click Me"); ListenForAcceptButton lForAButton = new ListenForAcceptButton(); ListenForDeclineButton lForDButton = new ListenForDeclineButton(); button1.addActionListener(lForAButton); button2.addActionListener(lForDButton); // movingButton.addActionListener(lForMButton); textArea1.setText("Tracking Events\n"); textArea1.setLineWrap(true); textArea1.setWrapStyleWord(true); textArea1.setSize(15, 50); textArea1.setEditable(false); FileReader reader = null; try { reader = new FileReader("EULA.txt"); textArea1.read(reader, "EULA.txt"); } catch (IOException exception) { System.err.println("Problem loading file"); exception.printStackTrace(); } finally { if (reader != null) { try { reader.close(); } catch (IOException exception) { System.err.println("Error closing reader"); exception.printStackTrace(); } } } AdjustmentListener sListener = new MyAdjustmentListener(); scrollBar1.getVerticalScrollBar().addAdjustmentListener(sListener); thePanel.add(scrollBar1); button1.setEnabled(false); thePanel.add(button1); thePanel.add(button2); frame.add(thePanel); ListenForMouse lForMouse = new ListenForMouse(); thePlacebo.addMouseListener(lForMouse); label1.setFont(font); thePlacebo.add(label1); frame2.add(thePlacebo); ListenForWindow lForWindow = new ListenForWindow(); frame.addWindowListener(lForWindow); frame2.addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyChar() == 'X' || e.getKeyChar() == 'x') { moveBallTimer.start(); } } }); frame.setVisible(true); moveBallTimer = new Timer( 900, new ActionListener() { public void actionPerformed(ActionEvent e) { moveBall(); // System.out.println("Timer started!"); repaint(); } }); addKeyListener( new KeyAdapter() { public void keyPressed(KeyEvent e) { if (frame2.isVisible()) { moveBallTimer.start(); } } }); setFont(new Font("Tahoma", Font.PLAIN, 11)); panelSurv1.setFont(new Font("Tahoma", Font.PLAIN, 11)); frame3.getContentPane().setLayout(new CardLayout(0, 0)); frame3.getContentPane().add(panelSurv1, ""); panelSurv1.setLayout(null); /* frame3.setVisible(true); frame3.setSize(600, 475); frame3.setResizable(false); frame3.setLocationRelativeTo(null); frame3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); */ JLabel lblNewLabel = new JLabel("How old are you?"); lblNewLabel.setBounds(22, 26, 112, 14); panelSurv1.add(lblNewLabel); JLabel lblNewLabel_1 = new JLabel("Select your gender:"); lblNewLabel_1.setBounds(366, 37, 115, 14); panelSurv1.add(lblNewLabel_1); JLabel lblNewLabel_2 = new JLabel("Current class level:"); lblNewLabel_2.setBounds(22, 56, 112, 14); panelSurv1.add(lblNewLabel_2); String[] classLevel = { "", "Freshman", "Sophomore", "Junior", "Senior", "Senior+", "Graduate Student", "Other" }; cmbClass = new JComboBox(classLevel); cmbClass.setName(""); cmbClass.setBounds(144, 53, 195, 20); panelSurv1.add(cmbClass); JLabel lblWhatIsYour = new JLabel("What is your major or field?"); lblWhatIsYour.setBounds(22, 102, 161, 14); panelSurv1.add(lblWhatIsYour); txtMajor = new JTextField(); txtMajor.setName(""); txtMajor.setColumns(10); txtMajor.setBounds(193, 99, 347, 20); panelSurv1.add(txtMajor); JLabel lblDidYouRead = new JLabel("Did you read the license agreement before installing Reflexology?"); lblDidYouRead.setBounds(22, 143, 392, 14); panelSurv1.add(lblDidYouRead); JLabel lblIfTheLicensing = new JLabel( "If the licensing agreement raised any privacy concerns, please type them below:"); lblIfTheLicensing.setBounds(22, 178, 503, 14); panelSurv1.add(lblIfTheLicensing); JLabel lblToHowMany = new JLabel("Up to how many friends may you gift Reflexology?"); lblToHowMany.setBounds(22, 247, 303, 14); panelSurv1.add(lblToHowMany); String[] numGifts = {"", "Don't know", "0", "1", "2", "3", "4"}; cmbNumGifts = new JComboBox(numGifts); cmbNumGifts.setBounds(320, 244, 205, 20); panelSurv1.add(cmbNumGifts); JLabel lblReflexologyProvidesThe = new JLabel("Reflexology provides the following warranty:"); lblReflexologyProvidesThe.setBounds(22, 280, 254, 14); panelSurv1.add(lblReflexologyProvidesThe); String[] theWarranty = { "", "Don't know", "Won't harm my computer", "Doesn't have viruses", "Money back guarantee", "None" }; cmbWarranty = new JComboBox(theWarranty); cmbWarranty.setBounds(296, 277, 157, 20); panelSurv1.add(cmbWarranty); JLabel lblWhoOwnsIntellectual = new JLabel("Who owns intellectual property created with Reflexology?"); lblWhoOwnsIntellectual.setBounds(22, 316, 372, 14); panelSurv1.add(lblWhoOwnsIntellectual); String[] IPOwner = { "", "Don't know", "Me", "The researchers", "Penn State", "Reflexology programmers" }; cmbIPOwner = new JComboBox(IPOwner); cmbIPOwner.setBounds(408, 313, 157, 20); panelSurv1.add(cmbIPOwner); btnPage2.setBounds(340, 400, 89, 23); panelSurv1.add(btnPage2); JLabel lblNewLabel_3 = new JLabel("*WARNING* You cannot return to these answers."); lblNewLabel_3.setForeground(Color.RED); lblNewLabel_3.setBounds(35, 404, 277, 14); panelSurv1.add(lblNewLabel_3); String[] gender = {"", "M", "F"}; cmbGender = new JComboBox(gender); cmbGender.setBounds(491, 34, 70, 20); panelSurv1.add(cmbGender); String[] didRead = {"", "Yes", "No"}; cmbDidRead = new JComboBox(didRead); cmbDidRead.setBounds(424, 140, 98, 20); panelSurv1.add(cmbDidRead); spnAge = new JSpinner(); spnAge.setModel(new SpinnerNumberModel(1, 1, 111, 1)); spnAge.setBounds(148, 23, 47, 20); panelSurv1.add(spnAge); txtPrivacyConcerns = new JTextField(); txtPrivacyConcerns.setName(""); txtPrivacyConcerns.setColumns(10); txtPrivacyConcerns.setBounds(22, 204, 547, 23); panelSurv1.add(txtPrivacyConcerns); frame3.getContentPane().add(panelSurv2, ""); panelSurv2.setLayout(null); JLabel lblNewLabel_4 = new JLabel("Estimate your overall comprehension of the License Agreement:"); lblNewLabel_4.setBounds(20, 18, 386, 14); panelSurv2.add(lblNewLabel_4); sldComp = new JSlider(); sldComp.setMajorTickSpacing(1); sldComp.setPaintTicks(true); sldComp.setPaintLabels(true); sldComp.setSnapToTicks(true); sldComp.setValue(-1); sldComp.setMinorTickSpacing(1); sldComp.setMinimum(1); sldComp.setMaximum(5); sldComp.setBounds(154, 43, 274, 45); panelSurv2.add(sldComp); JLabel lblNewLabel_5 = new JLabel("No comprehension"); lblNewLabel_5.setHorizontalAlignment(SwingConstants.RIGHT); lblNewLabel_5.setBounds(20, 43, 124, 25); panelSurv2.add(lblNewLabel_5); JLabel lblNewLabel_6 = new JLabel("Perfect Comprehension"); lblNewLabel_6.setBounds(438, 43, 138, 25); panelSurv2.add(lblNewLabel_6); JLabel lblIEnjoyUsing = new JLabel("I enjoy using technological applications (apps):"); lblIEnjoyUsing.setBounds(20, 99, 386, 14); panelSurv2.add(lblIEnjoyUsing); JLabel lblStronglyDisagree = new JLabel("Strongly disagree"); lblStronglyDisagree.setHorizontalAlignment(SwingConstants.RIGHT); lblStronglyDisagree.setBounds(20, 124, 124, 25); panelSurv2.add(lblStronglyDisagree); sldEnjoyTech = new JSlider(); sldEnjoyTech.setValue(-1); sldEnjoyTech.setSnapToTicks(true); sldEnjoyTech.setPaintTicks(true); sldEnjoyTech.setPaintLabels(true); sldEnjoyTech.setMinorTickSpacing(1); sldEnjoyTech.setMinimum(1); sldEnjoyTech.setMaximum(5); sldEnjoyTech.setMajorTickSpacing(1); sldEnjoyTech.setBounds(154, 124, 274, 45); panelSurv2.add(sldEnjoyTech); JLabel lblStronglyAgree = new JLabel("Strongly agree"); lblStronglyAgree.setBounds(438, 124, 138, 25); panelSurv2.add(lblStronglyAgree); JLabel lblIAmGood = new JLabel("I am good at using technological applications (apps):"); lblIAmGood.setBounds(20, 180, 386, 14); panelSurv2.add(lblIAmGood); sldUseTech = new JSlider(); sldUseTech.setValue(-1); sldUseTech.setSnapToTicks(true); sldUseTech.setPaintTicks(true); sldUseTech.setPaintLabels(true); sldUseTech.setMinorTickSpacing(1); sldUseTech.setMinimum(1); sldUseTech.setMaximum(5); sldUseTech.setMajorTickSpacing(1); sldUseTech.setBounds(154, 205, 274, 45); panelSurv2.add(sldUseTech); JLabel lblHowOftenDo = new JLabel("My friends ask me for computer and technology advice:"); lblHowOftenDo.setBounds(20, 261, 386, 14); panelSurv2.add(lblHowOftenDo); sldFriendsTech = new JSlider(); sldFriendsTech.setValue(-1); sldFriendsTech.setSnapToTicks(true); sldFriendsTech.setPaintTicks(true); sldFriendsTech.setPaintLabels(true); sldFriendsTech.setMinorTickSpacing(1); sldFriendsTech.setMinimum(1); sldFriendsTech.setMaximum(5); sldFriendsTech.setMajorTickSpacing(1); sldFriendsTech.setBounds(154, 286, 274, 45); panelSurv2.add(sldFriendsTech); JLabel label_1 = new JLabel("Strongly disagree"); label_1.setHorizontalAlignment(SwingConstants.RIGHT); label_1.setBounds(20, 205, 124, 25); panelSurv2.add(label_1); JLabel label_2 = new JLabel("Strongly disagree"); label_2.setHorizontalAlignment(SwingConstants.RIGHT); label_2.setBounds(20, 286, 124, 25); panelSurv2.add(label_2); JLabel label_3 = new JLabel("Strongly agree"); label_3.setBounds(438, 205, 138, 25); panelSurv2.add(label_3); JLabel label_4 = new JLabel("Strongly agree"); label_4.setBounds(438, 286, 138, 25); panelSurv2.add(label_4); JLabel label_5 = new JLabel("*WARNING* You cannot return to these answers."); label_5.setForeground(Color.RED); label_5.setBounds(80, 382, 277, 14); panelSurv2.add(label_5); btnPage3.setBounds(385, 378, 89, 23); panelSurv2.add(btnPage3); frame3.getContentPane().add(panelSurv3, ""); panelSurv3.setLayout(null); JLabel lblNewLabel_7 = new JLabel("Is there anything you enjoyed about the license agreement?"); lblNewLabel_7.setBounds(10, 11, 349, 14); panelSurv3.add(lblNewLabel_7); txtEnjoyedLic = new JTextField(); txtEnjoyedLic.setBounds(364, 8, 220, 20); panelSurv3.add(txtEnjoyedLic); txtEnjoyedLic.setColumns(10); JLabel lblNewLabel_8 = new JLabel("When you install reflexology, who are you entering an agreement with?"); lblNewLabel_8.setBounds(10, 36, 412, 14); panelSurv3.add(lblNewLabel_8); String[] whoAgree = { "", "Don't know", "State of PA", "Penn State", "PA Court of Common Pleas", "PA District Court", "Reflexology Development Team" }; cmbWhoAgree = new JComboBox(whoAgree); cmbWhoAgree.setBounds(432, 33, 152, 20); panelSurv3.add(cmbWhoAgree); JLabel lblTheLicenseAgreement = new JLabel("The license agreement applies to the following types of media:"); lblTheLicenseAgreement.setBounds(10, 61, 368, 14); panelSurv3.add(lblTheLicenseAgreement); String[] mediaTypes = { "", "Don't know", "Software", "Digital Media Content", "Print Material", "Documentation", "All of the above" }; cmbMediaTypes = new JComboBox(mediaTypes); cmbMediaTypes.setBounds(388, 61, 196, 20); panelSurv3.add(cmbMediaTypes); JLabel lblNewLabel_9 = new JLabel("Is it possible to purchase the Reflexology software? (explain below)"); lblNewLabel_9.setBounds(10, 86, 566, 14); panelSurv3.add(lblNewLabel_9); txtPurchasing = new JTextField(); txtPurchasing.setBounds(10, 111, 574, 20); panelSurv3.add(txtPurchasing); txtPurchasing.setColumns(10); JLabel lblTheLicenseAgreement_1 = new JLabel("The license agreement was visually appealing"); lblTheLicenseAgreement_1.setBounds(20, 145, 386, 14); panelSurv3.add(lblTheLicenseAgreement_1); JLabel label_7 = new JLabel("Strongly disagree"); label_7.setHorizontalAlignment(SwingConstants.RIGHT); label_7.setBounds(20, 170, 124, 25); panelSurv3.add(label_7); sldAesthetics = new JSlider(); sldAesthetics.setValue(-1); sldAesthetics.setSnapToTicks(true); sldAesthetics.setPaintTicks(true); sldAesthetics.setPaintLabels(true); sldAesthetics.setMinorTickSpacing(1); sldAesthetics.setMinimum(1); sldAesthetics.setMaximum(5); sldAesthetics.setMajorTickSpacing(1); sldAesthetics.setBounds(154, 170, 274, 45); panelSurv3.add(sldAesthetics); JLabel label_8 = new JLabel("Strongly agree"); label_8.setBounds(438, 170, 138, 25); panelSurv3.add(label_8); JLabel lblTheTextOf = new JLabel("This license agreement was easy to understand"); lblTheTextOf.setBounds(20, 226, 463, 14); panelSurv3.add(lblTheTextOf); JLabel label_10 = new JLabel("Strongly disagree"); label_10.setHorizontalAlignment(SwingConstants.RIGHT); label_10.setBounds(20, 251, 124, 25); panelSurv3.add(label_10); sldUnderstandLic = new JSlider(); sldUnderstandLic.setValue(-1); sldUnderstandLic.setSnapToTicks(true); sldUnderstandLic.setPaintTicks(true); sldUnderstandLic.setPaintLabels(true); sldUnderstandLic.setMinorTickSpacing(1); sldUnderstandLic.setMinimum(1); sldUnderstandLic.setMaximum(5); sldUnderstandLic.setMajorTickSpacing(1); sldUnderstandLic.setBounds(154, 251, 274, 45); panelSurv3.add(sldUnderstandLic); JLabel label_11 = new JLabel("Strongly agree"); label_11.setBounds(438, 251, 138, 25); panelSurv3.add(label_11); JLabel label_6 = new JLabel("Strongly disagree"); label_6.setHorizontalAlignment(SwingConstants.RIGHT); label_6.setBounds(20, 332, 124, 25); panelSurv3.add(label_6); sldAnnoyed = new JSlider(); sldAnnoyed.setValue(-1); sldAnnoyed.setSnapToTicks(true); sldAnnoyed.setPaintTicks(true); sldAnnoyed.setPaintLabels(true); sldAnnoyed.setMinorTickSpacing(1); sldAnnoyed.setMinimum(1); sldAnnoyed.setMaximum(5); sldAnnoyed.setMajorTickSpacing(1); sldAnnoyed.setBounds(154, 332, 274, 45); panelSurv3.add(sldAnnoyed); JLabel label_9 = new JLabel("Strongly agree"); label_9.setBounds(438, 332, 138, 25); panelSurv3.add(label_9); JLabel lblframe3LicenseAgreement = new JLabel("Something about this license agreement annoyed me"); lblframe3LicenseAgreement.setBounds(10, 304, 463, 14); panelSurv3.add(lblframe3LicenseAgreement); JLabel label_12 = new JLabel("*WARNING* You cannot return to these answers."); label_12.setForeground(Color.RED); label_12.setBounds(89, 404, 277, 14); panelSurv3.add(label_12); btnPage4.setBounds(394, 400, 89, 23); panelSurv3.add(btnPage4); frame3.getContentPane().add(panelSurv4, ""); panelSurv4.setLayout(null); JLabel lblNewLabel_10 = new JLabel("According to the license agreement, what does Penn State have "); lblNewLabel_10.setBounds(10, 11, 537, 14); panelSurv4.add(lblNewLabel_10); JLabel lblTheRightTo = new JLabel("the right to download from your computer?"); lblTheRightTo.setBounds(10, 26, 504, 14); panelSurv4.add(lblTheRightTo); txtPSUDownload = new JTextField(); txtPSUDownload.setBounds(10, 48, 553, 20); panelSurv4.add(txtPSUDownload); txtPSUDownload.setColumns(10); JLabel lblHowManyCopies = new JLabel("How many copies of Reflexology can you make for archival purposes?"); lblHowManyCopies.setBounds(10, 79, 438, 14); panelSurv4.add(lblHowManyCopies); String[] archCopies = {"", "Don't know", "0", "1", "3", "5", "Unlimited"}; cmbArchCopies = new JComboBox(archCopies); cmbArchCopies.setBounds(458, 79, 105, 20); panelSurv4.add(cmbArchCopies); JLabel lblYouCanLend = new JLabel("What can you do if you want to sue about Reflexology?"); lblYouCanLend.setBounds(10, 116, 323, 14); panelSurv4.add(lblYouCanLend); JLabel lblUnderWhatCircumstances = new JLabel("Under what circumstances can Penn State terminate your use of the software? "); lblUnderWhatCircumstances.setBounds(10, 184, 537, 14); panelSurv4.add(lblUnderWhatCircumstances); txtTerminate = new JTextField(); txtTerminate.setBounds(10, 209, 553, 20); panelSurv4.add(txtTerminate); txtTerminate.setColumns(10); sldTradKs = new JSlider(); sldTradKs.setValue(-1); sldTradKs.setSnapToTicks(true); sldTradKs.setPaintTicks(true); sldTradKs.setPaintLabels(true); sldTradKs.setMinorTickSpacing(1); sldTradKs.setMinimum(1); sldTradKs.setMaximum(5); sldTradKs.setMajorTickSpacing(1); sldTradKs.setBounds(154, 268, 274, 45); panelSurv4.add(sldTradKs); JLabel label_13 = new JLabel("Strongly disagree"); label_13.setHorizontalAlignment(SwingConstants.RIGHT); label_13.setBounds(20, 268, 124, 25); panelSurv4.add(label_13); JLabel label_14 = new JLabel("Strongly agree"); label_14.setBounds(438, 268, 138, 25); panelSurv4.add(label_14); JLabel lblPeopleAreMore = new JLabel( "People are more likely to read traditional contracts than software license agreemenets"); lblPeopleAreMore.setBounds(10, 240, 553, 14); panelSurv4.add(lblPeopleAreMore); JLabel lblwarningframe3Button = new JLabel("*WARNING* this button will instantly end the experiment ---->"); lblwarningframe3Button.setForeground(Color.RED); lblwarningframe3Button.setBounds(38, 400, 350, 14); panelSurv4.add(lblwarningframe3Button); btnDone.setBounds(398, 391, 89, 23); panelSurv4.add(btnDone); txtArbite = new JTextField(); txtArbite.setColumns(10); txtArbite.setBounds(10, 141, 553, 20); panelSurv4.add(txtArbite); ListenFor2Button lFor2Button = new ListenFor2Button(); ListenFor3Button lFor3Button = new ListenFor3Button(); ListenFor4Button lFor4Button = new ListenFor4Button(); ListenFor5Button lFor5Button = new ListenFor5Button(); btnPage2.addActionListener(lFor2Button); btnPage3.addActionListener(lFor3Button); btnPage4.addActionListener(lFor4Button); btnDone.addActionListener(lFor5Button); }
/** * Manage the associated panels design * * @param withparam * @param target * @param radius * @param rows */ protected void makeForm(boolean withparam, String target, String radius, int rows) { JPanel byword = null; // keyword panel JPanel fields = null; // fields panel JPanel parameters = null; // parameters panel JPanel lll = null; // 3 lists panel JPanel actions = null; // action panel int i; GridBagConstraints c = new GridBagConstraints(); // Form title setting titre = new MyLabel(DEFAULT_TITRE, Label.CENTER, PLAIN); titre.setBackground(Aladin.BLUE); fields = new JPanel(); fields.setLayout(new BorderLayout(3, 3)); byword = new JPanel(); byword.setBackground(Aladin.BLUE); byword.setLayout(new BorderLayout(3, 3)); byword.setFont(BOLD); // Construction // title panel and keyword query panel JPanel haut = new JPanel(); haut.setBackground(Aladin.BLUE); haut.setLayout(new BorderLayout(3, 3)); // Free keyword interrogation panel (author...) makeAdd(byword, new JLabel(KEYWORD), "West"); makeAdd(byword, tauthor, "Center"); // Window components are depending on if ((target == null && radius == null)) { // Target panel construction parameters = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); parameters.setLayout(gridbag); parameters.setFont(BOLD); JLabel label = new JLabel("Target "); c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(label, c); parameters.add(label); // Target field c = new GridBagConstraints(); c.gridx = 2; c.gridy = 0; c.gridwidth = 4; c.weightx = 1; c.weighty = 0.1; c.ipadx = 50; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(ttarget, c); parameters.add(ttarget); // Create and fill coordinate popup coordinate = new JComboBox(); coordinate.addItem("today"); coordinate.addItem("J2000"); coordinate.addItem("B1975"); coordinate.addItem("B1950"); coordinate.addItem("B1900"); coordinate.addItem("B1875"); coordinate.addItem("B1855"); coordinate.addItem("Galactic"); coordinate.addItem("Supergal."); coordinate.setSelectedItem("J2000"); // Coordinate field c = new GridBagConstraints(); c.gridx = 6; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(coordinate, c); parameters.add(coordinate); // Radius label label = new JLabel("Radius "); c = new GridBagConstraints(); c.gridx = 8; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(label, c); parameters.add(label); // Radius field c = new GridBagConstraints(); c.gridx = 10; c.gridy = 0; c.gridwidth = 1; c.weightx = 0.1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(tradius, c); parameters.add(tradius); tradius.setText("10.0"); // default value // Radius panel construction unit = new JComboBox(); unit.addItem("deg"); unit.addItem(ARCMIN); unit.addItem(ARCSEC); // Set default unit to arcmin unit.setSelectedItem(ARCMIN); c = new GridBagConstraints(); c.gridx = 11; c.gridy = 0; c.gridwidth = 2; c.weightx = 1; c.weighty = 0.1; c.insets = new Insets(5, 5, 5, 5); gridbag.setConstraints(unit, c); parameters.add(unit); } else { if (radius != null) tradius.setText(radius); if (target != null) ttarget.setText(target); } // Keywords section panel construction lll = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); lll.setLayout(gridbag); lll.setFont(BOLD); lll.setBackground(Aladin.BLUE); c = new GridBagConstraints(); lk = new JList[nSection]; JLabel label = null; for (int j = 0; j < nSection; j++) { label = new JLabel(); c = new GridBagConstraints(); c.gridx = j; c.gridy = 0; c.gridwidth = 1; c.weightx = 0.1; c.weighty = 0.1; c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.SOUTH; c.insets = new Insets(0, 0, 0, 0); gridbag.setConstraints(label, c); label.setText(getSectionName((String) vq.getNameKey().elementAt(j))); lll.add(label); Vector v = (Vector) vq.gethKey().get(vq.getNameKey().elementAt(j)); if (rows < 0) lk[j] = new JList(v); else { lk[j] = new JList(v); lk[j].setVisibleRowCount(rows); lk[j].setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } // Enumeration e = v.elements(); // while( e.hasMoreElements() ) // lk[j].addItem((String)e.nextElement()); c = new GridBagConstraints(); c.gridx = j; c.gridy = 1; c.gridwidth = 1; c.weightx = 1; c.weighty = 1; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(0, 2, 0, 2); JScrollPane jp = new JScrollPane(lk[j]); gridbag.setConstraints(jp, c); lll.add(jp); } // Change to a GridBagLayout to have non equal lists // Action button panel construction actions = new JPanel(); actions.setBackground(Aladin.BLUE); actions.setLayout(new FlowLayout(FlowLayout.RIGHT)); actions.setFont(BOLD); makeAdd(haut, titre, "North"); makeAdd(haut, byword, "Center"); if ((target == null && radius == null) && withparam == true) makeAdd(haut, parameters, "South"); // List and action panel JPanel bas = new JPanel(); bas.setBackground(Aladin.BLUE); bas.setLayout(new BorderLayout(3, 3)); makeAdd(bas, lll, "Center"); makeAdd(bas, actions, "South"); // Previous panels are added to the main frame makeAdd(this, haut, "North"); makeAdd(this, bas, "Center"); setTitre(this.target); }