aspose file tools
The moose likes Swing / AWT / SWT and the fly likes BorderLayout question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "BorderLayout question" Watch "BorderLayout question" New topic
Author

BorderLayout question

john-paul York
Greenhorn

Joined: Feb 15, 2011
Posts: 16
I am doing a program that is suppose to do the following:

Create a JFrame that uses BorderLayout. Place a JButton in the center region. Each time the user clicks the JButton, change the background colour in one of the other regions.

I am just looking for a answer to a quick question, do you have to add buttons into every region to see them? I keep looking for information on how to kind of have a blank region so I can change the background color, but can't find anything(all the examples I find add buttons/text areas)? I am thinking I should be able to add something else other then a button or text area to the other regions that makes those regions show up and then I can work with them.

JP

john-paul York
Greenhorn

Joined: Feb 15, 2011
Posts: 16
bah...I think I have it...JPanel....if I research JPanel this should put be in the right direction I am thinking?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32604
    
    4
john-paul York wrote: . . . do you have to add buttons into every region to see them?
No
. . . I should be able to add something else other then a button or text area to the other regions that makes those regions show up and then I can work with them.

JP

You appear to have worked that out already

I think this thread would sit better on our GUIs forum, so I shall move it.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: BorderLayout question
 
Similar Threads
Can't get an ActionListener to change a JLabel text
urgent ! swing design pattern
GUI flexibility
Image filtering (and other crazy stuff)
Regarding adding buttons inside BorderLayout at a specific location