Thanks for the response.
I don't think i can use a JTable for this particular problem (or i dont have enough experience w/JTable).
Here is what im trying to do:
Each row is a message which joins to another table which has various codes for that message,
they would like it to work like a word processor app, but i need to keep each line seprate
(adhere to the normalized db design).
each row will need jbuttons/jtextfields etc (for adding, editing, deleting message lines).
so what i did is... query the db build that many jPanels put them into a JGridLayout and showed on the screen.
everything works fine.
but when they make changes to a panel, i need a way to get that panel from the layout manager.
not components from JPanel, but JPanels from GridLayout.
or maybe im using the wrong layout for this problem?
Message was edited by:
llpindd
JFrame f = new JFrame("This is a test");
f.setSize(700, 600);
Container content = f.getContentPane();
//content.setBackground(Color.white);
CommentsMainPnl cp = new CommentsMainPnl ();
cp.getPnlAllComments().setLayout( new GridLayout(100,1));
cp.getPnlAllComments() .setPreferredSize( new Dimension(700,20));
for (int i = 0 ; i < 100 ; ++i){
cp.getPnlAllComments() .add( new CommentLnPanel () );
}
cp.getJspComments() .setViewportView(cp.getPnlAllComments() );
content.add( cp );
why does it sqeezes all the Jpanels together instead of creating a vertical scroll bar?
> why does it sqeezes all the Jpanels together instead of creating a vertical scroll bar?
I would guess that the preferred size of one of your custom panels is wrong, but the code you posted is of little use in determining the problem.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the posted code retains its original formatting.