This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextAreas with a GridLayout

 
Jacob Coddaire
Ranch Hand
Posts: 36
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys. Here's my code. It comes in two classes:





What I would like to do is make the output text area about twice the size of the errors text area. The majority of the program will be displayed in the output area, so I would like to have that take up a decent portion of the screen.

Also, for the customers JTextArea portion. I currently have them colored light grey. Is there any way to mimic the gray behind the JLabels that are right next to it? I want to have it look like a seamless integration from component to component.

Your help is much appreciated!
 
Rob Camick
Ranch Hand
Posts: 2542
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I would like to do is make the output text area about twice the size of the errors text area.


Then you can't use a GridLayout since all compnents are set to the same size. You can either use a SpringLayout (the Swing tutorial has a working example for creating a simple form like this) or a GridBagLayout, which is more complicated.

But first you need to create your text area with different preferred sizes. You can do this by using:

 
Jacob Coddaire
Ranch Hand
Posts: 36
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. I've also figured out the color thing. Case closed.

For reference, I used the following code on the color.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic