aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes beginer gui task. Please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "beginer gui task. Please help" Watch "beginer gui task. Please help" New topic
Author

beginer gui task. Please help

aidas kar
Greenhorn

Joined: Mar 08, 2013
Posts: 6
Hello

i'm reading book How to Program Java 9th deitel. And i'm just after introduction to gui.
And one of the tasks is to create gui without any functionality, i've attached the jpg of a gui.
But i'm not sure what LayoutManagers i ment to use. Cause its meant to be a simple task.
If you could point me to the right direction. Thanks
aidas kar
Greenhorn

Joined: Mar 08, 2013
Posts: 6
aidas kar wrote:Hello

i'm reading book How to Program Java 9th deitel. And i'm just after introduction to gui.
And one of the tasks is to create gui without any functionality, i've attached the jpg of a gui.
But i'm not sure what LayoutManagers i ment to use. Cause its meant to be a simple task.
If you could point me to the right direction. Thanks


[Thumbnail for task.jpg]

Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3169
    
  10
aidas kar wrote:But i'm not sure what LayoutManagers i ment to use.

Why don't you try experimenting with different layout managers and see what results you get. Far more interesting and you'll learn a lot more


Joanne
aidas kar
Greenhorn

Joined: Mar 08, 2013
Posts: 6
I did. No luck though. Book covered flowlayout, boarderlayout and gridlayout. And boxlayout only one method gethorizontalbox.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
Welcome to the Ranch
You do realise you can use several layouts simultaneously? You can have for example, a top panel, a middle panel and a bottom panel, which sounds like border layout. You can put grid layout on one panel and box on the other two. Just an example. You should find more details as you go through that tutorial. Remember: in grid layout you usually get all the components the same size.
They should be listed here, at least the more commonly‑used ones are. Flow layout is no good, and nobody can understand Spring layout.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
By the way: I think this discussion would fit better in our GUIs forum, so I shall move it.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3971
    
  17

aidas kar wrote:I did. No luck though. Book covered flowlayout, boarderlayout and gridlayout. And boxlayout only one method gethorizontalbox.

There is no one way to do this, there are many options. The key point to remember is that you can use multiple layouts, so you don't have to find just one that makes the entire layout. Take each portion of the GUI and think what layouts would be best to make that portion. Once you have them designed individually, then choose which layout(s) would be best to put the individual items together.


Steve
aidas kar
Greenhorn

Joined: Mar 08, 2013
Posts: 6
Thanks. I didn't realize I should add empty panels to center components. I thought there's some way to lay them out using managers.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
aidas kar wrote: . . . I thought there's some way to lay them out using managers.
You can with the “complicated” layouts like gridbag, or you can use several “simple” layouts like grid in different components in different parts of your display.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
And, “you’re welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: beginer gui task. Please help
 
Similar Threads
How to avoid system.exit(0)
Help with implementation - should I use threads???
Tab Change Issues
task scheduler in core java
Saving a Jpanel as a JPEG