• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

JTable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My GUI runs like this.I've 2 main panels on a frame.Frame is set to BorderLayout and the main panels are added to the frame.
first panel set above on the frame is set to gridLayout.
The first panel has 4 subpanel having comboboxes ant textfield.
Problem 1) when the GUI is activated I get a blank screen and then when I resize the frame using window maximize(-)
I get the proper Layout comboboxes and textfield.
how to rectify this?
Problem 2) How to add a JTable to the second mainPanel?
tried many things but didn't work.
Do anyone faced with a similar problem address my query?
Thanks in advance.
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

add the Jtable to a JScrollPane and then add the ScrollPane to the frame specifiyng BorderLayout.CENTER as the constraint. It worked for me , infact i have a very similar layout structure.
Okay intially try using pack() and then maximize. Hope it works.
I decided on a random setSize dimension.
karthik.

Originally posted by shubangini Dave:
My GUI runs like this.I've 2 main panels on a frame.Frame is set to BorderLayout and the main panels are added to the frame.
first panel set above on the frame is set to gridLayout.
The first panel has 4 subpanel having comboboxes ant textfield.
Problem 1) when the GUI is activated I get a blank screen and then when I resize the frame using window maximize(-)
I get the proper Layout comboboxes and textfield.
how to rectify this?
Problem 2) How to add a JTable to the second mainPanel?
tried many things but didn't work.
Do anyone faced with a similar problem address my query?
Thanks in advance.


 
Danger, 10,000 volts, very electic .... tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic