zoukankan      html  css  js  c++  java
  • Swing下拉框 代码 简单飞扬

    下拉框

    package swing;

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;

    public class JFCResume2 extends JFrame implements ItemListener {

        /** Initializes the applet Resume */
        public static void main (String[] args) {
            final JFCResume2 res = new JFCResume2();
            res.addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent evt) {
                    res.setVisible(false);
                    res.dispose();
                    System.exit(0);
                }
            });
            res.setLayoutManager();
            res.initComponents ();
            res.pack();
            res.setVisible(true);
        }

        public void setLayoutManager() {
            getContentPane().setLayout(new FlowLayout());
        }

        /** This method is called from within the init() method to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the FormEditor.
         */
        private void initComponents() {//GEN-BEGIN:initComponents
            choice2 = new JComboBox();
            choice2.addItem("Objective");
            choice2.addItem("Qualification");
            choice2.addItem("Experience");
            choice2.addItem("Skillset");
            choice2.addItem("Education");
            choice2.addItem("Training");
            choice2.addItemListener(this);
            //choice2.select(0);
            panel1 = new JPanel();
            panel2 = new JScrollPane();
            textArea1 = new JTextArea();
            panel3 = new JScrollPane();
            textArea2 = new JTextArea();
            panel4 = new JScrollPane();
            textArea3 = new JTextArea();
            panel5 = new JScrollPane();
            textArea4 = new JTextArea();
            panel6 = new JScrollPane();
            textArea5 = new JTextArea();
            panel7 = new JScrollPane();
            textArea6 = new JTextArea();

            choice2.setFont(new java.awt.Font ("Dialog", 0, 11));
            choice2.setName("choice2");
            choice2.setBackground(java.awt.Color.white);
            choice2.setForeground(java.awt.Color.black);

            getContentPane().add(choice2);


            panel1.setLayout(new java.awt.CardLayout());
            panel1.setFont(new java.awt.Font ("Dialog", 0, 11));
            panel1.setName("panel20");
            panel1.setBackground(new java.awt.Color (204, 204, 204));
            panel1.setForeground(java.awt.Color.black);

            panel2.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel2.setName("panel21");
              panel2.setBackground(new java.awt.Color (153, 153, 153));
              panel2.setForeground(java.awt.Color.black);

              textArea2.setBackground(new java.awt.Color (216, 208, 200));
                textArea2.setName("text4");
                textArea2.setEditable(false);
                textArea2.setFont(new java.awt.Font ("Courier New", 0, 12));
                textArea2.setColumns(80);
                textArea2.setForeground(new java.awt.Color (0, 0, 204));
                textArea2.setText("Seeking a challenging position as a JAVA Programmer."n");
                textArea2.setRows(20);
                panel2.getViewport().add(textArea2,null);

                panel1.add(panel2, "Objective");


            panel3.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel3.setName("panel22");
              panel3.setBackground(new java.awt.Color (153, 153, 153));
              panel3.setForeground(java.awt.Color.black);

              textArea1.setBackground(new java.awt.Color (216, 208, 200));
                textArea1.setName("text3");
                textArea1.setEditable(false);
                textArea1.setFont(new java.awt.Font ("Courier New", 1, 12));
                textArea1.setColumns(80);
                textArea1.setForeground(java.awt.Color.black);
                textArea1.setText("* 7 years C/C++ experience on UNIX/Windows"n * 7 years experience in RDBMS, including Oracle, Informix and Sybase"n* 3 years programming experience in JAVA on UNIX/WINDOWS"n* 2 years experience in designing and developing in J2EE"n ");
                textArea1.setRows(20);
                panel3.getViewport().add(textArea1,null);

                panel1.add(panel3, "Qualification");


            panel4.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel4.setName("panel23");
              panel4.setBackground(new java.awt.Color (153, 153, 153));
              panel4.setForeground(java.awt.Color.black);

              textArea3.setBackground(new java.awt.Color (216, 208, 200));
                textArea3.setName("text5");
                textArea3.setEditable(false);
                textArea3.setFont(new java.awt.Font ("Courier New", 0, 12));
                textArea3.setColumns(80);
                textArea3.setForeground(java.awt.Color.blue);
                textArea3.setText("Technical Support / Systems Engineer"nSun Microsystems Inc. China Ltd.  PRC "n");
                textArea3.setRows(20);
                panel4.getViewport().add(textArea3,null);

                panel1.add(panel4, "Experience");


            panel5.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel5.setName("panel24");
              panel5.setBackground(new java.awt.Color (153, 153, 153));
              panel5.setForeground(java.awt.Color.black);

              textArea4.setBackground(new java.awt.Color (216, 208, 200));
                textArea4.setName("text6");
                textArea4.setEditable(false);
                textArea4.setFont(new java.awt.Font ("Courier New", 0, 12));
                textArea4.setColumns(80);
                textArea4.setForeground(java.awt.Color.blue);
                textArea4.setText("Programming:C, C++, JAVA, HTML, XML "n");
                textArea4.setRows(20);
                panel5.getViewport().add(textArea4,null);

                panel1.add(panel5, "Skillset");


            panel6.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel6.setName("panel25");
              panel6.setBackground(new java.awt.Color (153, 153, 153));
              panel6.setForeground(java.awt.Color.black);

              textArea5.setBackground(new java.awt.Color (216, 208, 200));
                textArea5.setName("text7");
                textArea5.setEditable(false);
                textArea5.setFont(new java.awt.Font ("Courier New", 0, 12));
                textArea5.setColumns(80);
                textArea5.setForeground(java.awt.Color.blue);
                textArea5.setText("University of Science and Technology of China "n");
                textArea5.setRows(20);
                panel6.getViewport().add(textArea5,null);

                panel1.add(panel6, "Education");


            panel7.setFont(new java.awt.Font ("Dialog", 0, 11));
              panel7.setName("panel26");
              panel7.setBackground(new java.awt.Color (153, 153, 153));
              panel7.setForeground(java.awt.Color.black);

              textArea6.setBackground(new java.awt.Color (216, 208, 200));
                textArea6.setName("text8");
                textArea6.setEditable(false);
                textArea6.setFont(new java.awt.Font ("Courier New", 0, 12));
                textArea6.setColumns(80);
                textArea6.setForeground(java.awt.Color.blue);
                textArea6.setText("Sun Microsystems Inc. 1998-2001"nAttended training course "n");
                textArea6.setRows(20);
                panel7.getViewport().add(textArea6,null);

                panel1.add(panel7, "Training");


               getContentPane().add(panel1);

        }//GEN-END:initComponents

        public void itemStateChanged(ItemEvent evt) {
            CardLayout card = (CardLayout)panel1.getLayout();
            card.show(panel1, (String)evt.getItem());
        }
        // Variables declaration - do not modify//GEN-BEGIN:variables
        //private java.awt.Choice choice2;
        private JComboBox choice2;
        private JPanel panel1;
        private JScrollPane panel2;
        private JTextArea textArea1;
        private JScrollPane panel3;
        private JTextArea textArea2;
        private JScrollPane panel4;
        private JTextArea textArea3;
        private JScrollPane panel5;
        private JTextArea textArea4;
        private JScrollPane panel6;
        private JTextArea textArea5;
        private JScrollPane panel7;
        private JTextArea textArea6;
        // End of variables declaration//GEN-END:variables

    }

  • 相关阅读:
    AQS的子类在各个同步工具类中的使用情况
    SpringBoot RabbitMQ 延迟队列代码实现
    Java线程状态、线程start方法源码、多线程、Java线程池、如何停止一个线程
    Java内存模型,为啥线程要有自己的本地内存,CPU高速缓存
    Java内存模型中volatile关键字的作用
    Java内存模型、JVM内存结构和Java对象模型
    搞定springboot项目连接远程服务器上kafka遇到的坑以及完整的例子
    MongoDB导出与导入远程Linux服务器上的数据
    DeferredResult使用方式和场景
    【IT笔试面试题整理】二叉树中和为某一值的路径--从根到叶子节点
  • 原文地址:https://www.cnblogs.com/jiandanfy/p/1076541.html
Copyright © 2011-2022 走看看