Results 1 to 2 of 2
  1. #1
    saravanan049 is offline Member
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Post display one table column in jfarme window

    hi,, im trying to display one single column from a table in a jframe window.... in my code i can only display the last value of the column in the jframe window.. my code is here...

    b1.addActionListener(new ActionListener()
    {
    public void actionPerformed(ActionEvent e)
    {
    try
    {
    String sql="select job from db1";
    rs=st.executeQuery(sql);
    JFrame f2=new JFrame("Display page");
    int count=0;
    while(rs.next())
    {
    s=rs.getString(1);
    JLabel l=new JLabel(s);
    f2.setSize(300,300);
    f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f2.setVisible(true);
    JPanel p1=new JPanel();
    p1.add(l);
    f2.add(p1);
    count++;
    }
    }
    catch(Exception ex)
    {
    }
    }
    });

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,303
    Rep Power
    20

    Default Re: display one table column in jfarme window

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Can't add column to table dynamically
    By JOHNINALBANY in forum AWT / Swing
    Replies: 3
    Last Post: 07-07-2012, 08:03 AM
  2. Replies: 1
    Last Post: 07-06-2010, 04:50 PM
  3. Table column sort
    By new2java2009 in forum New To Java
    Replies: 5
    Last Post: 04-17-2010, 08:57 AM
  4. table column sort
    By new2java2009 in forum New To Java
    Replies: 8
    Last Post: 04-16-2010, 01:17 AM
  5. Non-Editable Table Column
    By ld_pvl in forum AWT / Swing
    Replies: 6
    Last Post: 08-03-2009, 06:35 PM

Tags for this Thread

Posting Permissions

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