h4han's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
18 (0.03 per day)
Joined:
05-September 12
Profile Views:
688
Last Active:
User is offline Oct 07 2012 03:31 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   h4han has not set their status

Posts I've Made

  1. In Topic: java gui problem

    Posted 8 Sep 2012

    thank you very much i success to do my code
    package hani;
    
    
    import java.awt.CardLayout;
    
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Rectangle;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    import java.util.Calendar;
    
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JEditorPane;
    import javax.swing.JFormattedTextField;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.SwingConstants;
    
    public class MainWindow extends JFrame {
        private CardLayout cardLayout1 = new CardLayout();
        private JPanel MainP1 = new JPanel();
        private JButton MainButton1 = new JButton();
        private JButton MainButton2 = new JButton();
        private JButton MainButton3 = new JButton();
        private JPanel FirstFaceWindow = new JPanel();
        private CardLayout cardLayout2 = new CardLayout();
        private JPanel FirstFace = new JPanel();
        private JButton FirstFaceButton = new JButton();
        private JLabel jLabel1 = new JLabel();
        private JLabel jLabel2 = new JLabel();
        private JComboBox jComboBox1 = new JComboBox();
        private JTextField jTextField1 = new JTextField();
        private JPanel SndFaceWindow = new JPanel();
        private CardLayout cardLayout3 = new CardLayout();
        private JPanel SndFace = new JPanel();
        private JLabel SndfaceL2 = new JLabel();
        private JLabel SndfaceL1 = new JLabel();
        private JTextField jTextField2 = new JTextField();
        private JTextField jTextField3 = new JTextField();
        private JButton SndFaceButton = new JButton();
        private JButton jButton2 = new JButton();
        private JPanel ThirdFaceWindow = new JPanel();
        private CardLayout cardLayout4 = new CardLayout();
        private JPanel ThirdFace = new JPanel();
        private JTextField jTextField4 = new JTextField();
        private JTextField jTextField5 = new JTextField();
        private JButton jButton1 = new JButton();
        private JButton jButton3 = new JButton();
        private JButton jButton4 = new JButton();
        private JLabel jLabel3 = new JLabel();
        private JLabel jLabel4 = new JLabel();
        private JTextField jTextField6 = new JTextField();
        
    
        public MainWindow() {
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        private void jbInit() throws Exception {
            this.getContentPane().setLayout(cardLayout1);
            MainP1.setLayout(null);
            MainP1.setBackground(new Color(0, 33, 115));
            MainButton1.setText("Holiday");
            MainButton1.setBounds(new Rectangle(15, 85, 100, 50));
            MainButton1.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        MainButton1_actionPerformed(e);
                    }
                });
            MainButton2.setText("Edite");
            MainButton2.setBounds(new Rectangle(150, 85, 100, 50));
            MainButton2.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        MainButton2_actionPerformed(e);
                    }
                });
            MainButton3.setText("Add");
            MainButton3.setBounds(new Rectangle(280, 85, 100, 50));
            MainButton3.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        MainButton3_actionPerformed(e);
                    }
                });
            FirstFacewindow.setLayout(null);
            FirstFace.setLayout(null);
            FirstFace.setBounds(new Rectangle(0, 0, 400, 270));
            FirstFaceButton.setText("Back");
            FirstFaceButton.setBounds(new Rectangle(145, 205, 110, 50));
            FirstFaceButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        FirstFaceButton_actionPerformed(e);
                    }
                });
            jLabel1.setText("Name");
            jLabel1.setBounds(new Rectangle(285, 55, 110, 45));
            jLabel2.setText("Holiday");
            jLabel2.setBounds(new Rectangle(285, 135, 110, 45));
            jComboBox1.setBounds(new Rectangle(5, 60, 270, 20));
            jTextField1.setBounds(new Rectangle(80, 140, 90, 40));
            SndFacewindow.setLayout(cardLayout3);
            SndFacewindow.setBackground(Color.black);
            SndFacewindow.setForeground(Color.red);
            SndFace.setLayout(null);
            SndFace.setBackground(new Color(0, 165, 82));
            SndFace.setForeground(new Color(0, 165, 0));
            SndfaceL2.setText("       Name");
            SndfaceL2.setBounds(new Rectangle(285, 30, 100, 45));
            SndfaceL2.setFont(new Font("Tahoma", 1, 11));
            SndfaceL1.setText("        Days");
            SndfaceL1.setBounds(new Rectangle(285, 90, 100, 45));
            SndfaceL1.setFont(new Font("Tahoma", 1, 11));
            jTextField2.setBounds(new Rectangle(15, 35, 225, 40));
            jTextField3.setBounds(new Rectangle(80, 95, 85, 40));
            SndFaceButton.setText("Add");
            SndFaceButton.setBounds(new Rectangle(225, 200, 105, 45));
            SndFaceButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        SndFaceButton_actionPerformed(e);
                    }
                });
            jButton2.setText("Back");
            jButton2.setBounds(new Rectangle(70, 200, 105, 45));
            jButton2.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jButton2_actionPerformed(e);
                    }
                });
            ThirdFacewindow.setLayout(cardLayout4);
            ThirdFace.setLayout(null);
            ThirdFace.setBackground(Color.black);
            ThirdFace.setFont(new Font("Dialog", 1, 20));
            ThirdFace.setVisible(false);
            jTextField4.setBounds(new Rectangle(15, 20, 245, 45));
            jTextField5.setBounds(new Rectangle(85, 75, 85, 50));
            jButton1.setText("Save");
            jButton1.setBounds(new Rectangle(260, 170, 95, 40));
            jButton3.setText("Delete");
            jButton3.setBounds(new Rectangle(25, 165, 95, 40));
            jButton4.setText("Back");
            jButton4.setBounds(new Rectangle(140, 210, 95, 40));
            jButton4.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jButton4_actionPerformed(e);
                    }
                });
            jLabel3.setText("       Name");
            
            jLabel3.setBounds(new Rectangle(300, 25, 90, 35));
            jLabel3.setForeground(Color.white);
            jLabel3.setFont(new Font("Tahoma", 1, 11));
            jLabel4.setText("       Days");
            jLabel4.setBounds(new Rectangle(305, 90, 60, 30));
            jLabel4.setForeground(Color.white);
            jLabel4.setFont(new Font("Tahoma", 1, 11));
            jTextField6.setBounds(new Rectangle(100, 160, 205, 20));
            jTextField6.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jTextField6_actionPerformed(e);
                    }
                });
            MainP1.add(MainButton3, null);
            MainP1.add(MainButton2, null);
            MainP1.add(MainButton1, null);
            this.getContentPane().add(MainP1, "jPanel1");
            FirstFace.add(jTextField1, null);
            FirstFace.add(jComboBox1, null);
            FirstFace.add(jLabel2, null);
            FirstFace.add(jLabel1, null);
            FirstFace.add(FirstFaceButton, null);
            FirstFacewindow.add(FirstFace, "jPanel2");
            this.getContentPane().add(FirstFaceWindow, "jPanel1");
            SndFace.add(jTextField6, null);
            SndFace.add(jButton2, null);
            SndFace.add(SndFaceButton, null);
            SndFace.add(jTextField3, null);
            SndFace.add(jTextField2, null);
            SndFace.add(SndfaceL1, null);
            SndFace.add(SndfaceL2, null);
            SndFacewindow.add(SndFace, "jPanel1");
            this.getContentPane().add(SndFaceWindow, "jPanel2");
            ThirdFace.add(jLabel4, null);
            ThirdFace.add(jLabel3, null);
            ThirdFace.add(jButton4, null);
            ThirdFace.add(jButton3, null);
            ThirdFace.add(jButton1, null);
            ThirdFace.add(jTextField5, null);
            ThirdFace.add(jTextField4, null);
            ThirdFacewindow.add(ThirdFace, "ThirdFace");
            this.getContentPane().add(ThirdFaceWindow, "jPanel1");
    
        }
            public static void main(String[] args) {
               MainWindow a = new MainWindow();
            a.setSize(420, 300);
            a.setVisible(true);
            a.setDefaultCloseOperation(EXIT_ON_CLOSE);}
    
    
        private void FirstFaceButton_actionPerformed(ActionEvent e) {
            cardLayout1.previous(this.getContentPane());
        }
    
        private void MainButton1_actionPerformed(ActionEvent e) {
            cardLayout1.next(this.getContentPane());
           
          
        }
        private void MainButton2_actionPerformed(ActionEvent e) {
           // cardLayout1.next(this.getContentPane());
            cardLayout1.previous(this.getContentPane()); 
            cardLayout1.previous(this.getContentPane());
        }
    
        private void MainButton3_actionPerformed(ActionEvent e) {
            cardLayout1.previous(this.getContentPane());
        }
    
        private void SndFaceButton_actionPerformed(ActionEvent e) {
        }
    
        private void jButton2_actionPerformed(ActionEvent e) {
            cardLayout1.next(this.getContentPane());
            cardLayout1.next(this.getContentPane());
            
        }
    
        private void jButton4_actionPerformed(ActionEvent e) {
            cardLayout1.next(this.getContentPane());
        }
    
        private void jTextField6_actionPerformed(ActionEvent e) {
            Calendar rightNow = Calendar.getInstance(); 
            
        }            
    }
    
    
    
  2. In Topic: Creating a calendar viewer application

    Posted 8 Sep 2012

    View Postalpha02, on 08 July 2007 - 11:33 AM, said:

    View PostTheKingOfCodes, on 8 Jul, 2007 - 01:41 PM, said:

    [size=2]think you so much for this amaizing codes, for this i have choosen this code to be my project in java, but
    it there is something missing in this code which is you didn't make any sign or highlight the cell in jtable
    to keep track on date, so i have been tring to solve this for four days and with out any gain so please complete the missing part and i'd be so appreciated if so, and thinks again.


    The tutorial has been updated, now the current day is highlighted blue :)



    how can i call it in another application
  3. In Topic: java gui problem

    Posted 8 Sep 2012

    no i am review what you post and learn from your advice but when i do what you told me no thing happen

    
    package project2;
    
    import java.awt.CardLayout;
    
    import java.awt.LayoutManager;
    import java.awt.Rectangle;
    
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    
    public class Class1 extends JFrame {
        private CardLayout cardLayout1 = new CardLayout();
        private JPanel c1 = new JPanel();
        private JButton jButton1 = new JButton();
        private LayoutManager cards ;
        public Class1() {
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        public static void main(String[] args) {
            Class1 a=new Class1();
            a.setSize(500, 500);
            a.setVisible(true);
            a.setDefaultCloseOperation(EXIT_ON_CLOSE);
        }
    
        private void jbInit() throws Exception {
            this.getContentPane().setLayout(cardLayout1);
            c1.setLayout(null);
            jButton1.setText("ok");
            jButton1.setBounds(new Rectangle(130, 150, 135, 55));
            jButton1.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jButton1_actionPerformed(e);
                    }
                });
            c1.add(jButton1, null);
            this.getContentPane().add(c1, "jPanel1");
        }
    
        private void jButton1_actionPerformed(ActionEvent e) {
           // i want it refer to the second class 
            if ( e.getSource() == jButton1 )
                    {Class2 q=new Class2();
            q.setSize(500, 500);
            q.setVisible(true);
                        cardLayout1.show( this.getContentPane(), "c2" );
    
                       
                    }
                    else
                    {
                            cardLayout1.show( this.getContentPane(), "c1" );
                    }
          
         
        }
    }
    
    

    
    package project2;
    
    import java.awt.CardLayout;
    
    import java.awt.Font;
    import java.awt.Rectangle;
    
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingConstants;
    
    public class Class2 extends JPanel {
    
        private CardLayout cardLayout = new CardLayout();
        private JPanel c2 = new JPanel();
        private JLabel jLabel1 = new JLabel();
    
        public Class2() {
            try {
                jbInit();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        private void jbInit() throws Exception {
            this.setLayout(cardLayout);
            c2.setLayout(null);
            jLabel1.setText("Han");
            jLabel1.setBounds(new Rectangle(110, 165, 200, 75));
            jLabel1.setFont(new Font("Tahoma", 1, 50));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            c2.add(jLabel1, null);
            this.add(c2, "jPanel1");
        }
        public static void main(String[] args) {
            Class2 q=new Class2();
            q.setSize(500, 500);
            q.setVisible(true);
           
        }
    }
    
    
  4. In Topic: java gui problem

    Posted 8 Sep 2012

    how can i Switch which cards are displayed programmatically
  5. In Topic: java gui problem

    Posted 7 Sep 2012

    no i didn't i still trying and i can't

    i am just learned java from week so i don't have expert

    no i didn't i still trying and i can't

    i am just learned java from week so i don't have expert to fix the problem

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

Comments

h4han has no profile comments yet. Why not say hello?