• Post Reply Bookmark Topic Watch Topic
  • New Topic

Border Layout does not paint

 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried two approaches:

add(textArea,BorderLayout.CENTER);
addLayoutComponent(textArea,BorderLayout.CENTER);

JWindow shows up on screen and responds to window close operation, background is painted, but nothing shows up in the window.


[ August 05, 2007: Message edited by: Nicholas Jordan ]
 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try

getContentPane().add( comp, BorderLayout.SOUTH);
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
comment out this line
//GUI.this.setLayout(GUI.this.borderlayout);//

borderLayout is the default
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Chu Tan:]getContentPane().add( comp, BorderLayout.SOUTH);

No effect on stated problem, code - abbreviated from actual code in development:


I must have mis-quoted my code in haste as this is one approach I tried. It occured to me pack() may need to be called at some other point and there is other issues that may be tried - some sample code has the following:


[ August 07, 2007: Message edited by: Nicholas Jordan ]
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Michael Dunn: ]comment out this line //GUI.this.setLayout(GUI.this.borderlayout);// borderLayout is the default
Okay, took it out completly. There is much of that and other things I have to take out of my actual prototyping code because it confuses me to write small, tight code. {  causes me to wonder what it is actually producing as it's idea of what I want to do } The compiler takes out what it does not need, btw: default values for paramater lists would be really handy right now for some of my ideas - I forgot whether Java supports default values for paramater lists.

[ Message edit: still working on this, reading my 1,000 page java certification study guide and it appears that may provide needed insightl]
[ August 12, 2007: Message edited by: Nicholas Jordan ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!