• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SWING+JTABLE(Urgent Please)

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody!
Please help me to solve the problems below:
#1.I want ScrollBars in a FORM(extend JFrame) which is populated with
many Components.How can i do this.
#2.I have made JDialog opens from a FORM(extends JFrame) through
'Findbtn'.JDialog populated with JTable has been used for fetching data
from database. but the problem is how can I get text from JTable
to the textfield of Form.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
#1. Create an extra JPanel. Instead of adding components directly to the content pane of the frame, add them to this panel. Put this panel in a JScrollPane, and then add the JScrollPane to the content pane.

#2. There are lots of ways to do this... you can extend dialog to have methods to set each field, you can have one method that takes some kind of collection (like a hashtable) that is filled out with the data, instead of a collection, you can pass the table model and the row number you want to display... etc. There is no built in way to do this, but there are several ways to do it yourself...
 
reply
    Bookmark Topic Watch Topic
  • New Topic