public CFSecuritySwingISOCurrencyAskDeleteJPanel( ICFSecuritySwingSchema argSchema, ICFSecurityISOCurrencyObj argFocus) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. swingSchema = argSchema; swingFocus = argFocus; // Construct the various objects textAreaMessage = new JTextArea("Are you sure you want to delete this ISO Currency?"); actionOk = new ActionOk(); actionCancel = new ActionCancel(); buttonOk = new JButton(actionOk); buttonCancel = new JButton(actionCancel); attrJPanel = argSchema.getISOCurrencyFactory().newAttrJPanel(argFocus); scrollPane = new CFHSlaveJScrollPane(attrJPanel); // Lay out the widgets setSize(1024, 480); Dimension min = new Dimension(480, 300); setMinimumSize(min); add(textAreaMessage); textAreaMessage.setBounds(0, 0, 1024, 50); int xparts = (768 - (2 * 125)) / 3; add(buttonOk); buttonOk.setBounds(xparts, 55, 125, 40); add(buttonCancel); buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40); add(scrollPane); scrollPane.setBounds(0, 100, 1024, 480 - 100); }
private JPanel getJContentPane() { if (jContentPane == null) { jLabel6 = new JLabel(); jLabel6.setBounds(new Rectangle(11, 72, 218, 19)); jLabel6.setText("Install log directory:"); jLabel5 = new JLabel(); jLabel5.setBounds(new Rectangle(11, 2, 394, 26)); jLabel5.setText("Advanced Install. Please select your preferences"); ButtonGroup group = new ButtonGroup(); pathSuffix = new JTextArea(); pathSuffix.setBounds(new Rectangle(232, 48, 61, 21)); pathSuffix.setText("BIRCH"); jLabel4 = new JLabel(); jLabel4.setBounds(new Rectangle(22, 351, 312, 20)); jLabel4.setText("* - Automatically detected, recommended."); jLabel3 = new JLabel(); jLabel3.setBounds(new Rectangle(220, 48, 10, 21)); jLabel3.setText(" /"); jLabel2 = new JLabel(); jLabel2.setBounds(new Rectangle(18, 250, 132, 18)); jLabel2.setText("Binaries:"); jLabel1 = new JLabel(); jLabel1.setBounds(new Rectangle(11, 115, 127, 21)); jLabel1.setText("Framework Type:"); jLabel = new JLabel(); jLabel.setBounds(new Rectangle(11, 28, 131, 17)); jLabel.setText("Install directory:"); jContentPane = new JPanel(); jContentPane.setLayout(null); jContentPane.setSize(new Dimension(464, 376)); jContentPane.add(jLabel, null); jContentPane.add(getJButton(), null); jContentPane.add(getJTextArea(), null); jContentPane.add(jLabel3, null); jContentPane.add(pathSuffix, null); jContentPane.add(jLabel1, null); jContentPane.add(getJCheckBox(), null); jContentPane.add(getJCheckBox1(), null); jContentPane.add(jLabel2, null); jContentPane.add(getJCheckBox2(), null); jContentPane.add(getJCheckBox3(), null); jContentPane.add(getJCheckBox4(), null); jContentPane.add(getJCheckBox5(), null); jContentPane.add(getJCheckBox6(), null); jContentPane.add(getLogTextField(), null); jContentPane.add(getLogButton(), null); jContentPane.add(jLabel4, null); jContentPane.add(getWindows32Checkbox(), null); jContentPane.add(getJRadioButton(), null); jContentPane.add(jLabel5, null); jContentPane.add(jLabel6, null); jContentPane.add(getGitRadioButton(), null); jContentPane.add(getGitComboBox(), null); group.add(releaseRadioButton); group.add(developmentRadioButton); group.add(gitRadioButton); } return jContentPane; }
public void doLayout() { Dimension sz = getSize(); textAreaMessage.setBounds(0, 0, sz.width, 50); int xparts = (sz.width - (2 * 125)) / 3; buttonOk.setBounds(xparts, 55, 125, 40); buttonCancel.setBounds(xparts + 125 + xparts, 55, 125, 40); scrollPane.setBounds(0, 100, sz.width, sz.height - 100); scrollPane.doLayout(); }
public ShowComp() throws InterruptedException, IOException { super("CONNECTED COMPUTERS"); int x = 0, d = 20; mb = new JMenuBar(); File = new JMenu("File"); mb.add(File); exit = new JMenuItem("Exit"); exit.addActionListener(this); File.add(exit); ta = new JTextArea(); ta.setBounds(20, 30, 315, 470); ta.setEditable(false); add(ta); setJMenuBar(mb); sel = new JLabel("The connected computers are.."); sel.setBounds(15, 5, 300, 30); add(sel); b1 = new JButton("<< BACK"); b1.setBounds(140, 510, 100, 30); b1.setToolTipText("Back to main page"); b1.addActionListener(this); add(b1); setLayout(null); while (x < 360) { x = x + d; setBounds(675, 50, x, 600); this.show(); } // setVisible(true); String s = "192.168.0.", temp = null; Printer printer = new Printer(); printer.start(); Connector connector = new Connector(printer); connector.start(); LinkedList targets = new LinkedList(); for (int i = 1; i <= 255; i++) { temp = s + Integer.toString(i); Target t = new Target(temp); targets.add(t); connector.add(t); } Thread.sleep(2000); connector.shutdown(); connector.join(); for (Iterator i = targets.iterator(); i.hasNext(); ) { Target t = (Target) i.next(); if (!t.shown) t.show(); } setDefaultCloseOperation(DISPOSE_ON_CLOSE); }
/** * Creates the terminal for interaction with client from server * * @param s */ public Terminal(Server s) { mServer = s; TextFieldListener tfListener = new TextFieldListener(); input.addActionListener(tfListener); Display = new javax.swing.JLayeredPane(); input.setColumns(50); output.setColumns(50); output.setRows(30); output.setEditable(false); output.setBackground(Color.BLACK); output.setForeground(Color.WHITE); input.requestFocus(); // start with focus on this field output.setBounds(0, 0, 550, 310); Display.add(output, javax.swing.JLayeredPane.DEFAULT_LAYER); input.setBounds(0, 320, 550, 25); Display.add(input, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent( Display, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( Display, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE)))); pack(); }
// create and position GUI components; register event handlers private void createUserInterface() { // get content pane for attaching GUI components Container contentPane = getContentPane(); // enable explicit positioning of GUI components contentPane.setLayout(null); // set up principalJLabel principalJLabel = new JLabel(); principalJLabel.setBounds(20, 20, 80, 20); principalJLabel.setText("Principal:"); contentPane.add(principalJLabel); // set up principalJTextField principalJTextField = new JTextField(); principalJTextField.setBounds(80, 20, 90, 20); principalJTextField.setText("0"); principalJTextField.setHorizontalAlignment(JTextField.RIGHT); contentPane.add(principalJTextField); // set up resultJLabel resultJLabel = new JLabel(); resultJLabel.setBounds(20, 60, 100, 20); resultJLabel.setText("Result:"); contentPane.add(resultJLabel); // set up resultJTextArea resultJTextArea = new JTextArea(); resultJTextArea.setBounds(20, 85, 260, 120); resultJTextArea.setEditable(false); contentPane.add(resultJTextArea); // set up calculateJButton calculateJButton = new JButton(); calculateJButton.setBounds(190, 20, 90, 20); calculateJButton.setText("Calculate"); contentPane.add(calculateJButton); calculateJButton.addActionListener( new ActionListener() // anonymous inner class { // event handler called when calculateJButton is pressed public void actionPerformed(ActionEvent event) { calculateJButtonActionPerformed(event); } } // end anonymous inner class ); // end call to addActionListener // set properties of application's window setTitle("Comparing Rates"); // set title bar text setSize(310, 255); // set window size setVisible(true); // display window } // end method createUserInterface
/** * This method initializes jTextArea * * @return javax.swing.JTextArea */ private JTextArea getJTextArea() { if (installDirTextArea == null) { String path; path = System.getProperty("user.home"); installDirTextArea = new JTextArea(); installDirTextArea.setEditable(false); installDirTextArea.setText(System.getProperty("user.home")); installDirTextArea.setBounds(new Rectangle(13, 49, 206, 21)); } return installDirTextArea; }
private void GUI() { // gui components JFrame frame = new JFrame(); JPanel pane = new JPanel(); // buttons and areas JTextArea uName = new JTextArea("Spy Alias"); JTextArea pWord = new JTextArea("Top Secret Password"); JButton submit = new JButton("Login"); JButton register = new JButton("Register"); // sizing GUI components submit.setBounds(545, 260, 100, 50); register.setBounds(650, 260, 100, 50); uName.setBounds(545, 200, 100, 50); pWord.setBounds(650, 200, 100, 50); // adding action listeners submit.addActionListener(this); // sizing, making visible, and adding pane to Frame frame.setLayout(null); frame.setVisible(true); frame.setSize(1600, 850); frame.add(pane); // adding components to panel and sizing pane.setLayout(null); pane.setSize(1600, 850); pane.add(uName); pane.add(pWord); pane.add(submit); pane.add(register); frame.setDefaultCloseOperation(EXIT_ON_CLOSE); }
private void addTextField() { messageArea = new JTextArea(); messageArea.setEnabled(false); messageArea.setDisabledTextColor(Color.BLACK); listArea = new JTextArea(); listArea.setEnabled(false); listArea.setDisabledTextColor(Color.BLACK); listArea.setBounds(275, 18, 70, 340); contentPane.add(listArea); textField = new JTextField(); textField.setBounds(0, 312, 155, 42); textField.addKeyListener(this); contentPane.add(textField); textField.setColumns(10); }
public MainScreen(Out out) { beep = new JButton("Beep"); beep.addActionListener(this); beeps = new JButton("Beeps"); beeps.addActionListener(this); reset = new JButton("Reset"); reset.addActionListener(this); name = new JButton("Name"); name.addActionListener(this); version = new JButton("Version"); version.addActionListener(this); clear = new JButton("Clear"); clear.addActionListener(this); area = new JTextArea(30, 80); id = new JTextField(25); id.setEditable(false); this.out = out; setSize(640, 480); setVisible(false); setTitle("PROMAG"); setLayout(null); getContentPane().add(beep); getContentPane().add(beeps); getContentPane().add(reset); getContentPane().add(name); getContentPane().add(version); getContentPane().add(clear); getContentPane().add(id); getContentPane().add(area); beep.setBounds(540, 10, 80, 30); beeps.setBounds(540, 60, 80, 30); reset.setBounds(540, 110, 80, 30); name.setBounds(540, 160, 80, 30); version.setBounds(540, 210, 80, 30); clear.setBounds(540, 260, 80, 30); id.setBounds(540, 310, 80, 30); area.setBounds(10, 10, 520, 470); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
/** 删除教务处老师或院系教务老师: 若还有其他该角色的老师则直接删除, 否则要求用户添加一名新的老师,若不添加则不能删除 */ private void deleteJW(final int row, String role) { AdminBLService ad = new AdminController(); ArrayList<UserVo> user = ad.getUser(role); if (user.size() > 1) { String result = ad.deleteUser( new UserVo((String) table.getValueAt(row, 0), role, "", "", "", "", "", "", 0, "")); Methods.showTip(result); } else { JDialog tip = new JDialog(); tip.getContentPane().setLayout(null); tip.setTitle("~~~"); tip.setSize(350, 200); tip.setLocationRelativeTo(null); JTextArea area = new JTextArea("请先添加一名新的用户来接管该" + Methods.eToC(role) + "的\r\n工作再执行删除"); area.setBounds(42, 44, 260, 60); tip.getContentPane().add(area); tip.setVisible(true); } }
Swing4(String s) { f=new JFrame(s); ta=new JTextArea(); ta.setBounds(50,50,400,200); f.add(ta); tf=new JTextField(); tf.setBounds(50,300,100,50); f.add(tf); b=new JButton("FIND"); b.setBounds(200,300,100,50); b.addActionListener(this); f.add(b); b1=new JButton("NEXT"); b1.setBounds(350,300,100,50); b1.addActionListener(this); b1.setVisible(false); f.add(b1); tf1=new JTextField(); tf1.setBounds(50,400,100,50); f.add(tf1); b2=new JButton("REPLACE"); b2.setBounds(200,400,100,50); b2.addActionListener(this); f.add(b2); f.setLayout(null); f.setSize(500,500); f.setVisible(true); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
InputFrame() { JPanel pane = new JPanel(); pane.setLayout(null); pane.setBackground(Color.LIGHT_GRAY); add(pane); // JTextField文字欄位元件 lblName = new JLabel("姓名:"); lblName.setBounds(10, 10, 40, 20); pane.add(lblName); text0.setBounds(50, 10, 80, 20); text0.addActionListener(textfield); pane.add(text0); // JSpinner數位序列元件 lblAge = new JLabel("年齡:"); lblAge.setBounds(170, 10, 40, 20); pane.add(lblAge); JSpinner spin = new JSpinner(new SpinnerNumberModel(20, 1, 100, 1)); spin.setBounds(210, 10, 80, 20); spin.addChangeListener(spinner); pane.add(spin); // JRadioButton選項圓鈕元件 lblSex = new JLabel("性別:"); lblSex.setBounds(10, 40, 40, 20); pane.add(lblSex); ButtonGroup group = new ButtonGroup(); JRadioButton rb1 = new JRadioButton("帥哥", false); rb1.setBounds(50, 40, 60, 20); JRadioButton rb2 = new JRadioButton("美女", false); rb2.setBounds(110, 40, 60, 20); rb1.setOpaque(false); rb2.setOpaque(false); // 秀出底色 rb1.addActionListener(radio); rb2.addActionListener(radio); group.add(rb1); group.add(rb2); pane.add(rb1); pane.add(rb2); // JCheckBox核對方塊元件 lblInter = new JLabel("興趣:"); lblInter.setBounds(10, 70, 50, 20); pane.add(lblInter); for (int i = 0; i < check.length; i++) { check[i] = new JCheckBox(checkItem[i]); check[i].setBounds(50 + 60 * i, 70, 60, 20); check[i].setOpaque(false); check[i].addActionListener(checkbox); pane.add(check[i]); } // JComboBox下拉式清單元件 lblAcad = new JLabel("學歷:"); lblAcad.setBounds(10, 100, 50, 20); pane.add(lblAcad); String[] items_c = {"博士", "碩士", "大學", "高中", "國中", "國小"}; JComboBox c_box = new JComboBox(items_c); c_box.setBounds(50, 100, 100, 20); c_box.addItemListener(cbo); pane.add(c_box); // JList清單元件 lblPlace = new JLabel("居住地區:"); lblPlace.setBounds(170, 100, 70, 20); pane.add(lblPlace); String[] items_p = { "台北", "桃園", "新竹", "苗栗", "台中", "彰化", "雲林", "嘉義", "台南", "高雄", "屏東", "花蓮", "台東", "澎湖" }; JList list = new JList(items_p); list.setVisibleRowCount(4); list.addListSelectionListener(list_p); JScrollPane scroll = new JScrollPane(list); scroll.setBounds(240, 100, 80, 80); pane.add(scroll); // JTextArea文字區域元件 texta.setBounds(10, 190, 330, 40); texta.setEditable(false); pane.add(texta); setTitle("輸入元件綜合應用"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(50, 50, 360, 280); setVisible(true); }
Intern_Chat() { frame = new JFrame("Guide ME"); frame.setSize(480, 550); frame.setResizable(false); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setBackground(new Color(211, 211, 211)); frame.getContentPane().setLayout(null); // getContentPane().addMouseListener(new action2()); JLabel lblGuideMe = new JLabel("Guide ME"); lblGuideMe.setFont(new Font("Tahoma", Font.BOLD, 16)); lblGuideMe.setBounds(10, 11, 85, 21); frame.getContentPane().add(lblGuideMe); textField = new JTextField(); textField.setBounds(105, 11, 135, 21); frame.getContentPane().add(textField); textField.setColumns(10); ImageIcon search = new ImageIcon("list.PNG"); btnNewButton = new JButton(search); btnNewButton.addActionListener(new Intern_Chat_action()); btnNewButton.setBackground(new Color(255, 255, 255)); btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 11)); btnNewButton.setBounds(240, 11, 20, 21); frame.getContentPane().add(btnNewButton); btnNewButton_1 = new JButton("Home"); btnNewButton_1.addActionListener(new Intern_Chat_action()); btnNewButton_1.setForeground(new Color(0, 0, 0)); btnNewButton_1.setBackground(new Color(65, 105, 225)); btnNewButton_1.setBounds(265, 12, 78, 21); frame.getContentPane().add(btnNewButton_1); ImageIcon list = new ImageIcon("Capture.PNG"); btnNewButton_2 = new JButton(list); btnNewButton_2.setBounds(350, 11, 22, 23); btnNewButton_2.setForeground(new Color(0, 0, 0)); btnNewButton_2.setBackground(new Color(65, 105, 225)); frame.getContentPane().add(btnNewButton_2); btnNewButton_2.addActionListener(new Intern_Chat_action()); btnNewButton_3 = new JButton(list); btnNewButton_3.addActionListener(new Intern_Chat_action()); btnNewButton_3.setBounds(380, 11, 22, 23); frame.getContentPane().add(btnNewButton_3); String content[] = { "Friends", "Places", "Brands", "Notifications", "Tastes", "Rates", "Message", "settings", "Log out" }; // for view frinds and palces and brands lists = new JList(content); lists.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); lists.setBackground(new Color(65, 105, 225)); frame.getContentPane().add(lists); lists.setBounds(295, 35, 74, 171); lists.hide(); String content2[] = { "Chick In", "Add Friend", "Add Place", "Add Brand", "Give Rate", "Remove Friend", "Remove Brand", "Remove Place", "chat" }; lists1 = new JList(content2); lists1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); lists1.setBackground(new Color(65, 105, 225)); frame.getContentPane().add(lists1); lists1.setBounds(379, 35, 95, 171); lists1.hide(); lists.addListSelectionListener(new Intern_Chat_action()); lists1.addListSelectionListener(new Intern_Chat_action()); JPanel panel_1 = new JPanel(); panel_1.setBackground(new Color(0, 191, 255)); panel_1.setBounds(0, 0, 560, 50); frame.getContentPane().add(panel_1); panel = new JPanel(); panel.setBounds(0, 101, 185, 418); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); JScrollPane scr1 = new JScrollPane(panel); scr1.setBounds(0, 101, 185, 418); JLabel Users[] = new JLabel[20]; JLabel message[] = new JLabel[20]; for (int i = 0; i < 20; i++) { if (i % 2 == 0) { Users[i] = new JLabel("12:52 : alaa"); message[i] = new JLabel("how are you bitch ?"); } else { Users[i] = new JLabel("12:52: You"); message[i] = new JLabel("f**k you"); } panel.add(Users[i]); panel.add(message[i]); } frame.getContentPane().add(scr1); lblChat = new JLabel("Chat"); lblChat.setFont(new Font("Tahoma", Font.BOLD, 14)); lblChat.setBounds(23, 61, 72, 29); frame.getContentPane().add(lblChat); textArea = new JTextArea(); textArea.setBounds(230, 120, 173, 69); JScrollPane scr = new JScrollPane(textArea); scr.setBounds(230, 120, 173, 69); frame.getContentPane().add(scr); JButton btnSend = new JButton("Send"); btnSend.setFont(new Font("Tahoma", Font.BOLD, 14)); btnSend.setBounds(264, 197, 78, 23); frame.getContentPane().add(btnSend); }
public PicsHerosFrame(PicsHerosHeroManager heroManager) { super("3 photos 1 Hero"); this.heroManager = heroManager; heroManager.createHeroList(); // dhmiourgoume prwta thn lista hrwwn this.setSize(900, 680); // mpainei prin ta setBounds gia na doulepsei to this setBounds(100, 100, this.getWidth(), this.getHeight()); mainPanel = new JPanel(); mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(mainPanel); mainPanel.setLayout(null); anyHero = this.heroManager.getHero(); photo1 = new JLabel(); photo1.setBounds(50, 200, 250, 250); mainPanel.add(photo1); photo2 = new JLabel(); photo2.setBounds(310, 200, 250, 250); mainPanel.add(photo2); photo3 = new JLabel(); photo3.setBounds(570, 200, 250, 250); mainPanel.add(photo3); commitBt = new JButton("The pics are about..."); commitBt.setBounds(200, 500, 150, 30); buttonListener = new myButtonListener(); commitBt.addActionListener(buttonListener); mainPanel.add(commitBt); nameArea = new JTextArea(); nameArea.setBounds(350, 500, 300, 30); nameArea.setBackground(Color.ORANGE); nameArea.setEditable(true); mainPanel.add(nameArea); // kataskeyh stoixeiwn parathyrou ImageIcon background = new ImageIcon("olympus.jpg"); Image image = background.getImage(); backlbl = new JLabel(); backlbl.setBounds(0, 0, this.getWidth(), this.getHeight()); Image resizedImage = image.getScaledInstance(backlbl.getWidth(), backlbl.getHeight(), 0); backlbl.setIcon(new ImageIcon(resizedImage)); // prosarmogh eikonas fontou mainPanel.add(backlbl); getNextHero(); // yparxei gia na exoume enan arxiko hrwa alliws bgazei keno this.setResizable(false); // den epitrepei allagh megethous sto parathyro this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private void jbInit() throws Exception { final JLabel textAndFont = new JLabel(Messages.getMessage("PdfViewerLabel.TextAndFont")); textAndFont.setFont(new java.awt.Font("Dialog", Font.BOLD, 14)); textAndFont.setDisplayedMnemonic('0'); textAndFont.setBounds(new Rectangle(13, 13, 220, 26)); final JLabel left = new JLabel(Messages.getMessage("PdfViewerLabel.Left")); left.setBounds(new Rectangle(130, 40, 50, 23)); final JLabel center = new JLabel(Messages.getMessage("PdfViewerLabel.Center")); center.setBounds(new Rectangle(300, 40, 50, 23)); final JLabel right = new JLabel(Messages.getMessage("PdfViewerLabel.Right")); right.setBounds(new Rectangle(475, 40, 50, 23)); final JLabel header = new JLabel(Messages.getMessage("PdfViewerLabel.Header")); header.setBounds(new Rectangle(20, 60, 90, 23)); final JLabel footer = new JLabel(Messages.getMessage("PdfViewerLabel.Footer")); footer.setBounds(new Rectangle(20, 90, 50, 23)); leftHeaderBox.setBounds(new Rectangle(85, 60, 133, 23)); centerHeaderBox.setBounds(new Rectangle(250, 60, 133, 23)); rightHeaderBox.setBounds(new Rectangle(425, 60, 133, 23)); leftFooterBox.setBounds(new Rectangle(85, 90, 133, 23)); centerFooterBox.setBounds(new Rectangle(250, 90, 133, 23)); rightFooterBox.setBounds(new Rectangle(425, 90, 133, 23)); final JLabel font = new JLabel(Messages.getMessage("PdfViewerLabel.Font")); font.setBounds(new Rectangle(20, 120, 75, 23)); fontsList.setBounds(new Rectangle(85, 120, 150, 23)); fontsList.setSelectedItem("Helvetica"); final JLabel size = new JLabel(Messages.getMessage("PdfViewerLabel.Size")); size.setBounds(new Rectangle(250, 120, 50, 23)); fontSize.setBounds(new Rectangle(290, 120, 50, 23)); final JLabel color = new JLabel(Messages.getMessage("PdfViewerLabel.Color")); color.setBounds(new Rectangle(360, 120, 50, 23)); colorBox.setBackground(Color.black); colorBox.setOpaque(true); colorBox.setBounds(new Rectangle(410, 120, 23, 23)); final JButton chooseColor = new JButton(Messages.getMessage("PdfViewerButton.ChooseColor")); chooseColor.setBounds(new Rectangle(450, 120, 160, 23)); chooseColor.addActionListener( new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { colorBox.setBackground( JColorChooser.showDialog(null, "Color", colorBox.getBackground())); } }); tagsList.setText( "You may use the following\n" + "tags as part of the text.\n\n" + "<d> - Date in short format\n" + "<D> - Date in long format\n" + "<t> - Time in 12-hour format\n" + "<T> - Time in 24-hour format\n" + "<f> - Filename\n" + "<F> - Full path filename\n" + "<p> - Current page number\n" + "<P> - Total number of pages"); tagsList.setOpaque(false); tagsList.setBounds(350, 160, 200, 210); final JLabel margins = new JLabel(Messages.getMessage("PdfViewerLabel.Margins")); margins.setFont(new java.awt.Font("Dialog", Font.BOLD, 14)); margins.setDisplayedMnemonic('0'); margins.setBounds(new Rectangle(13, 150, 220, 26)); final JLabel leftRight = new JLabel(Messages.getMessage("PdfViewerLabel.LeftAndRight")); leftRight.setBounds(new Rectangle(20, 185, 90, 23)); leftRightBox.setBounds(new Rectangle(100, 185, 70, 23)); final JLabel topBottom = new JLabel(Messages.getMessage("PdfViewerLabel.TopAndBottom")); topBottom.setBounds(new Rectangle(180, 185, 120, 23)); topBottomBox.setBounds(new Rectangle(300, 185, 70, 23)); pageRangeLabel.setText(Messages.getMessage("PdfViewerPageRange.text")); pageRangeLabel.setBounds(new Rectangle(13, 220, 400, 26)); printAll.setText(Messages.getMessage("PdfViewerRadioButton.All")); printAll.setBounds(new Rectangle(23, 250, 75, 22)); printCurrent.setText(Messages.getMessage("PdfViewerRadioButton.CurrentPage")); printCurrent.setBounds(new Rectangle(23, 270, 100, 22)); printCurrent.setSelected(true); printPages.setText(Messages.getMessage("PdfViewerRadioButton.Pages")); printPages.setBounds(new Rectangle(23, 292, 70, 22)); pagesBox.setBounds(new Rectangle(95, 292, 230, 22)); pagesBox.addKeyListener( new KeyListener() { @Override public void keyPressed(final KeyEvent arg0) {} @Override public void keyReleased(final KeyEvent arg0) { if (pagesBox.getText().isEmpty()) { printCurrent.setSelected(true); } else { printPages.setSelected(true); } } @Override public void keyTyped(final KeyEvent arg0) {} }); final JTextArea pagesInfo = new JTextArea(Messages.getMessage("PdfViewerMessage.PageNumberOrRangeLong")); pagesInfo.setBounds(new Rectangle(23, 320, 620, 40)); pagesInfo.setOpaque(false); this.add(printAll, null); this.add(printCurrent, null); this.add(printPages, null); this.add(pagesBox, null); this.add(pagesInfo, null); this.add(left, null); this.add(center, null); this.add(right, null); this.add(header, null); this.add(footer, null); this.add(leftHeaderBox, null); this.add(centerHeaderBox, null); this.add(rightHeaderBox, null); this.add(leftFooterBox, null); this.add(centerFooterBox, null); this.add(rightFooterBox, null); this.add(font, null); this.add(fontsList, null); this.add(size, null); this.add(fontSize, null); this.add(color, null); this.add(colorBox, null); this.add(chooseColor, null); this.add(margins, null); this.add(leftRight, null); this.add(leftRightBox, null); this.add(topBottom, null); this.add(topBottomBox, null); this.add(textAndFont, null); this.add(changeButton, null); this.add(pageRangeLabel, null); // this.add(tagsList, null); this.add(jToggleButton2, null); this.add(jToggleButton3, null); buttonGroup1.add(printAll); buttonGroup1.add(printCurrent); buttonGroup1.add(printPages); }
/** * 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); }
/* * GUI Code to add a modpack to the selection */ public void addPack(final ModPack pack) { if (!modPacksAdded) { modPacksAdded = true; packs.removeAll(); packs.repaint(); } final int packIndex = packPanels.size(); final JPanel p = new JPanel(); p.setBounds(0, (packIndex * 55), 420, 55); p.setLayout(null); JLabel logo = new JLabel(new ImageIcon(pack.getLogo())); logo.setBounds(6, 6, 42, 42); logo.setVisible(true); JTextArea filler = new JTextArea( pack.getName() + " (v" + pack.getVersion() + ") Minecraft Version " + pack.getMcVersion() + "\n" + "By " + pack.getAuthor()); filler.setBorder(null); filler.setEditable(false); filler.setForeground(LauncherStyle.getCurrentStyle().tabPaneForeground); filler.setBounds(58, 6, 362, 42); filler.setBackground(LauncherStyle.getCurrentStyle().tabPaneBackground); MouseAdapter lin = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { LaunchFrame.getInstance().doLaunch(); } } @Override public void mousePressed(MouseEvent e) { selectedPack = packIndex; updatePacks(); } }; p.addMouseListener(lin); filler.addMouseListener(lin); logo.addMouseListener(lin); p.add(filler); p.add(logo); packPanels.add(p); packs.add(p); packs.setMinimumSize(new Dimension(420, (packPanels.size() * 55))); packs.setPreferredSize(new Dimension(420, (packPanels.size() * 55))); // // packsScroll.revalidate(); if (pack.getDir().equalsIgnoreCase(getLastPack())) { selectedPack = packIndex; } }
public PlayerSideBar(JPanel panel, final PlayerMedia frame) { this.contentPane = panel; this.frame = frame; // ******************** Button for listening to text entered ********** btnListen = new JButton("Listen"); btnListen.setEnabled(false); btnListen.setBackground(Color.GRAY); btnListen.setForeground(Color.WHITE); // ActionListener to perform the speaking when pressed btnListen.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { // disable listen button so speak only one thing at a time btnListen.setEnabled(false); ListenBG ListenWorker = new ListenBG(frame); // execute SwingWorker ListenWorker.execute(); } }); btnListen.setBounds(750, 192, 135, 40); contentPane.add(btnListen); // ****************************************************************** // ********************** Create mp3 (TTS) ***************************** btnCreateMp = new JButton("Create mp3"); btnCreateMp.setEnabled(false); btnCreateMp.setBackground(Color.GRAY); btnCreateMp.setForeground(Color.WHITE); // ActionListener: Creates mp3 from text entered TTS btnCreateMp.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { // ask user to enter desired output name final String output = JOptionPane.showInputDialog(null, "Enter Mp3 Name: "); File f = new File(output + ".mp3"); if (output != null && output.length() > 0) { if (f.exists() && !f.isDirectory()) { // ask if user would want to overwrite existing file int reply = JOptionPane.showConfirmDialog( null, "File already exists, overwrite?", "Overwrite?", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.YES_OPTION) { CreateMp3BG maker = new CreateMp3BG(frame, output); maker.execute(); } } else { CreateMp3BG maker = new CreateMp3BG(frame, output); maker.execute(); } } } }); btnCreateMp.setBounds(905, 192, 142, 40); contentPane.add(btnCreateMp); // ****************************************************************** // *************Button to combined selected audio and video files************* btnAddCom = new JButton("Merge Video/Audio\n"); btnAddCom.setBackground(Color.GRAY); btnAddCom.setForeground(Color.WHITE); btnAddCom.setFont(new Font("Dialog", Font.BOLD, 22)); btnAddCom.setBounds(750, 334, 297, 100); btnAddCom.setEnabled(false); btnAddCom.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { // pick a name for the output file final String comOutName = JOptionPane.showInputDialog("Enter New Video Name: "); File f = new File(comOutName + ".avi"); if (comOutName != null && comOutName.length() > 0) { if (f.exists() && !f.isDirectory()) { // ask if user would want to overwrite existing file int reply = JOptionPane.showConfirmDialog( null, "File already exists, overwrite?", "Overwrite?", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.YES_OPTION) { // generate swingworker instance AddCommentaryBG adder = new AddCommentaryBG(frame, comOutName); adder.execute(); } } else { // generate swingworker instance AddCommentaryBG adder = new AddCommentaryBG(frame, comOutName); adder.execute(); } } } }); contentPane.add(btnAddCom); // Label to indicate how many characters are remaining lblChars = new JLabel("200/200"); lblChars.setForeground(Color.WHITE); lblChars.setBounds(980, 170, 70, 15); contentPane.add(lblChars); // *************************************************************************** // *****************simple text area for the user to enter text ****************** txtArea = new JTextArea(); txtArea.setText("Add Text Here"); txtArea.setWrapStyleWord(true); txtArea.setRows(5); txtArea.setToolTipText("Enter text for text to speech. "); txtArea.setFont(new Font("Dialog", Font.PLAIN, 15)); txtArea.setLineWrap(true); txtArea.setBounds(551, 41, 302, 122); txtArea.setDocument(docfilt); contentPane.add(txtArea); // ****** Scroll pane which allow text area to scroll ************************** scrollPane = new JScrollPane(txtArea); scrollPane.setBounds(750, 41, 297, 122); contentPane.add(scrollPane); JLabel textLabel = new JLabel("Enter text for text-to-speech"); scrollPane.setColumnHeaderView(textLabel); // **************** Document Filter to count characters ************************ // set the maximum character to 200 so the festival voice doesn't die docfilt.setDocumentFilter(new DocumentSizeFilter(200)); // add a listener to show user how many characters remaining docfilt.addDocumentListener( new DocumentListener() { @Override public void changedUpdate(DocumentEvent e) { charCount(); } @Override public void insertUpdate(DocumentEvent e) { charCount(); } @Override public void removeUpdate(DocumentEvent e) { charCount(); } }); // ****************************************************************** // *************** Button to open window for eiditing commentary ***************** btnEdit = new JButton("Add Audio Files To Merge"); btnEdit.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent arg0) { edit.setVisible(true); } }); btnEdit.setForeground(Color.WHITE); btnEdit.setFont(new Font("Dialog", Font.BOLD, 18)); btnEdit.setBackground(Color.GRAY); btnEdit.setBounds(750, 244, 297, 78); contentPane.add(btnEdit); // ********************************************************************************* }
public void actionPerformed(ActionEvent e) { String t = fid.getText(); // char[] t2=fpass.getPassword(); String t2 = fpass.getText(); try { DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); Connection con = DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:xe", "system", "9696030257"); Statement st = con.createStatement(); ResultSet rs = st.executeQuery( "select * from database where userid='" + t + "' AND password='******'"); rs.next(); String g = rs.getString("userid"); String h = rs.getString("password"); String i = rs.getString("mob"); String j = rs.getString("dob"); if (g.equals(t) && h.equals(t2)) { // JOptionPane.showMessageDialog(null,"WoW !! You Are a Valid User"); JFrame jf1 = new JFrame("About Saras"); jf1.setBounds(500, 40, 500, 500); jf1.setVisible(true); jf1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf1.setLayout(null); String ab = "\n\nHis Name is Saraswatendra Singh.\nHe is pursuing B.Tech from ABES Engineering College(032) Ghaziabad U.P.\nHe is belong from VARANASI which is also called BANARAS.\nHis Email and Facebook id is <*****@*****.**>\n\n\n \t\t\tTHANK YOU"; String bc = "\n\n\nABOUT YOU:-\n\n\t UserId is < " + g + " >\n\t Password is <" + h + " > \n\t Mobile No is < " + i + " >\n\t Date Of Birth(dd/mm/yyyy) is < " + j + " >\n \n\nABOUT DEVELOPER:-" + ab; JTextArea about = new JTextArea(bc); jf1.add(about); about.setBounds(0, 0, 500, 500); JButton rest = new JButton("ResetPassword"); about.add(rest); rest.setBounds(30, 400, 150, 20); Cursor k1 = new Cursor(Cursor.HAND_CURSOR); rest.setCursor(k1); rest.addActionListener(new ResetPassword()); JButton restmob = new JButton("ResetMobileNo"); about.add(restmob); restmob.setBounds(230, 400, 150, 20); Cursor k2 = new Cursor(Cursor.HAND_CURSOR); restmob.setCursor(k2); restmob.addActionListener(new ResetMob()); } } catch (Exception ex) { System.out.print(ex); JOptionPane.showMessageDialog( null, "UserId or Password MissMatched !!! please Enter Valid UserId and Password"); } }
/** Creates the design and add the input field to the panel */ public void addField() { exeTxt.setBounds(55, 195, 300, 30); exeTxt.setFont(txtFont); exeTxt.setBorder(new EtchedBorder()); clipPnl.add(exeTxt); }
/** Inits the GUI */ public void initGui() { setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); setBounds(0, 0, resWidth, resHeight); // setBounds(0, 0, screenSize.width, screenSize.height); contentPane.setBorder(new EmptyBorder(0, 0, 0, 0)); setContentPane(contentPane); cl = new CardLayout(0, 0); contentPane.setLayout(cl); contentPane.add(mainMenu, "name_6798406101994"); mainMenu.setLayout(null); previousPanel = mainMenu; currentPanel = mainMenu; addGamePanels(); /* ************************ Extra Exit button ********************* */ // This extra exit button is only used during the development, for easy // shutdown of the program. // In the delivery version, there will be no exit button, because the // user should never be able // to return the operating system of the console. // JButton btnClose = new JButton("Exit"); // btnClose.setBounds(100, 10, 165, 68); // mainMenu.add(btnClose); // btnClose.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) { // System.exit(0); // Yes, system.exit in the GUI - simply because this // is only a dev's button. // } // }); /* *********************** end Extra Exit button******************* */ /* *************************** Options Stuff ********************** */ optionsMenu = new JPanel(); contentPane.add(optionsMenu, "name_7946040729344"); optionsMenu.setLayout(null); taSound.setFont(new Font("Tahoma", Font.PLAIN, 15)); taSound.setBounds(748, 163 + 59 + 68 / 4, 165, 34); optionsMenu.add(taSound); taIP.setText(optionsMenuConnectedIP); taIP.setFont(new Font("Tahoma", Font.PLAIN, 15)); taIP.setBounds(748, 210 + 59 + 68 / 4, 165, 234); optionsMenu.add(taIP); btnSound.setBounds(748, 83 + 59 + 68 / 4, 165, 68); this.controller.addOptionMenuButton(btnSound); optionsMenu.add(btnSound); btnSound.setText("Turn sound on/off"); btnGetGameList.setBounds(748, 83, 165, 68); this.controller.addOptionMenuButton(btnGetGameList); optionsMenu.add(btnGetGameList); btnGetGameList.setText("Update game list"); /* ************************ End options Stuff ********************* */ /* ************************** "About" stuff *********************** */ aboutMenu = new JPanel(); contentPane.add(aboutMenu, "name_8765118079202"); aboutMenu.setLayout(null); txtrAbout.setBounds(648, 210, 265, 234); aboutMenu.add(txtrAbout); /* *********************** End "About" stuff ********************** */ mainMenuButtons(); initBG(mainMenu, bgMain, "/bg1.jpg"); initBG(optionsMenu, bgOptions, "/bg2.jpg"); initBG(aboutMenu, bgAbout, "/bg2.jpg"); }