📄 subdomain.java~14~
字号:
package Statistics;import javax.swing.*;import java.awt.*;import java.awt.event.*;public class SubDomain extends JFrame { JLabel jLabel1 = new JLabel(); JLabel jLabel2 = new JLabel(); JComboBox jComboBox1 = new JComboBox(); JComboBox jComboBox2 = new JComboBox(); JLabel jLabel3 = new JLabel(); JLabel jLabel4 = new JLabel(); JLabel jLabel5 = new JLabel(); JLabel jLabel6 = new JLabel(); JLabel jLabel7 = new JLabel(); JLabel jLabel8 = new JLabel(); JScrollPane jScrollPane1 = new JScrollPane(); JScrollPane jScrollPane2 = new JScrollPane(); JScrollPane jScrollPane3 = new JScrollPane(); JList jList1 = new JList(); JList jList2 = new JList(); JList jList3 = new JList(); JTextField jTextField1 = new JTextField(); JTextField jTextField2 = new JTextField(); public SubDomain() { try { jbInit(); } catch(Exception ex) { ex.printStackTrace(); } } void jbInit() throws Exception { jLabel1.setFont(new java.awt.Font("Dialog", 0, 16)); jLabel1.setHorizontalAlignment(SwingConstants.CENTER); jLabel1.setHorizontalTextPosition(SwingConstants.TRAILING); jLabel1.setText("Access Statistics for Web Pages"); jLabel1.setBounds(new Rectangle(121, 27, 293, 24)); this.getContentPane().setLayout(null); jLabel2.setFont(new java.awt.Font("Dialog", 2, 12)); jLabel2.setHorizontalAlignment(SwingConstants.CENTER); jLabel2.setText("Total Transfers by Reserved Subdomain"); jLabel2.setBounds(new Rectangle(145, 69, 240, 23)); jComboBox1.setBounds(new Rectangle(21, 143, 134, 20)); jComboBox1.addItem("Hongkong"); jComboBox1.addItem("Malaysia"); jComboBox1.addItem("Mexico"); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { jComboBox1_actionPerformed(e); } }); jComboBox2.setBounds(new Rectangle(171, 142, 67, 20)); jComboBox2.addItem("my"); jComboBox2.addItem("hk"); jComboBox2.addItem("mx"); jLabel3.setText("Country"); jLabel3.setBounds(new Rectangle(24, 122, 64, 16)); jLabel4.setText("Code"); jLabel4.setBounds(new Rectangle(171, 125, 43, 12)); jLabel5.setPreferredSize(new Dimension(34, 15)); jLabel5.setText("IP Name"); jLabel5.setBounds(new Rectangle(251, 126, 80, 15)); jLabel6.setText("Requests"); jLabel6.setBounds(new Rectangle(418, 121, 69, 20)); jLabel7.setRequestFocusEnabled(true); jLabel7.setText("Bytes Sent"); jLabel7.setBounds(new Rectangle(495, 121, 69, 19)); jLabel8.setText("Total"); jLabel8.setBounds(new Rectangle(295, 440, 76, 18)); jScrollPane1.setBounds(new Rectangle(253, 143, 161, 289)); jScrollPane2.setBounds(new Rectangle(419, 143, 59, 290)); jScrollPane3.setBounds(new Rectangle(497, 143, 92, 289)); jTextField1.setText(""); jTextField1.setBounds(new Rectangle(376, 440, 64, 18)); jTextField2.setText(""); jTextField2.setBounds(new Rectangle(453, 437, 93, 19)); this.getContentPane().add(jComboBox1, null); this.getContentPane().add(jLabel3, null); this.getContentPane().add(jLabel8, null); this.getContentPane().add(jTextField1, null); this.getContentPane().add(jTextField2, null); this.getContentPane().add(jLabel1, null); this.getContentPane().add(jLabel2, null); this.getContentPane().add(jLabel7, null); this.getContentPane().add(jScrollPane3, null); this.getContentPane().add(jScrollPane2, null); this.getContentPane().add(jLabel6, null); this.getContentPane().add(jScrollPane1, null); jScrollPane1.getViewport().add(jList1, null); this.getContentPane().add(jLabel5, null); this.getContentPane().add(jLabel4, null); this.getContentPane().add(jComboBox2, null); jScrollPane2.getViewport().add(jList2, null); jScrollPane3.getViewport().add(jList3, null); this.setBounds(0,0,600,600); this.setVisible(true); this.setDefaultCloseOperation(1); } public static void main(String[] args) { SubDomain subDomain = new SubDomain(); } void jComboBox1_actionPerformed(ActionEvent e) { String selectedItem = (String)jComboBox1.getSelectedItem(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -