Results 1 to 6 of 6
  1. #1
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default How to create 3 columns and 2 rows tablelayout in Java

    Dear The Expert,

    How to create 3 columns and 2 rows tablelayout in Java?

    please help

    thanks & regards
    newbiejava

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Are you asking about using JTable or about a layout of components in a container?

  3. #3
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default

    yes, I am asking about layout of components in a container.. any idea?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,902
    Rep Power
    25

    Default

    Look at the GridLayout class.

  5. #5
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    GridBagLayout

  6. #6
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default

    trying using below codes .. gives me more confusing :(

    Java Code:
    import java.awt.GridLayout;;
    import java.text.Normalizer.Form;
    import javax.swing.JButton;
    
    
    public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new FrmMain().setVisible(true);
    
    
                    createLayout(this);
    
                }
            });
        }
    
    private static void createLayout(Form frm) {
        // set form layout
            GridLayout gridLayout = new GridLayout(3,2);
            frm.setLayout(gridLayout);
            frm.add(new JButton("Button 1"));
    	frm.add(new JButton("Button 2"));
    	frm.add(new JButton("Button 3"));
    	frm.add(new JButton("Long-Named Button 4"));
    	frm.add(new JButton("5"));
        }

Similar Threads

  1. How To Add More Rows To Excel Sheet In Java
    By JMartins in forum New To Java
    Replies: 0
    Last Post: 12-31-2009, 12:30 AM
  2. Need a loop for rows and columns
    By Ceasar in forum New To Java
    Replies: 4
    Last Post: 10-09-2009, 04:03 PM
  3. Counting Rows and Columns from Excel Sheet
    By Anish in forum Advanced Java
    Replies: 3
    Last Post: 12-24-2008, 07:56 AM
  4. Two diM aRRay and add rows and columns....
    By filly444 in forum New To Java
    Replies: 2
    Last Post: 08-30-2008, 06:24 PM
  5. How to create a SWT Tree with multi columns
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 05:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •