This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Swing GUI Interface Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing GUI Interface Question" Watch "Swing GUI Interface Question" New topic

Swing GUI Interface Question

Rebecca Plumb

Joined: Dec 09, 2007
Posts: 9
Hi, I have to create a gui interface, that doesn't have any backend functionality. It is supposed to be similiar to an address program like outlook. I have implemented all of the components except 1 - I have to display a person in the contacts/organizer. I have to create a static array & a person contstruct. Where would I place this? Inside Contact form in the text fields?

Here is the code:

[ June 02, 2008: Message edited by: Campbell Ritchie ]

Rob Spoor

Joined: Oct 27, 2005
Posts: 20136


please UseCodeTags in the future.

Can some bartender move this to Swing?

How To Ask Questions How To Answer Questions
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44590

Why are you assigning your static Strings to null? You want

private static final String OPEN = "Open";

or simply write "Open" where you need it.

I think your Person needs a separate class; keep your "model" and your "view" in separate classes.

Are you using FlowLayout? Watch the behaviour of your GUI if you resize it from left to right.

And Rob is right; I was going to move you to Swing anyway. Because I am feeling in a benign mood I shall add code tags so you can see how much easier it is to read.
I agree. Here's the link:
subject: Swing GUI Interface Question
It's not a secret anymore!