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 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); }
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); }
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); }
/** * 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); }
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"); } }
/* * 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; } }
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); }
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); }