It's not a secret anymore!*
The moose likes Beginning Java and the fly likes GUI with constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "GUI with constructor" Watch "GUI with constructor" New topic
Author

GUI with constructor

xiao sean
Ranch Hand

Joined: Aug 20, 2007
Posts: 44
hi,
i'm trying to build a program to match a string of id to another string 1234567 with a GUI and constructor.
but i'm struck and confuse on how to i continue with the constructor method
please advice how do i carry on...

[ September 22, 2007: Message edited by: xiao sean ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

What are you stuck on? Compiling? A runtime error? How to implement something specific?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
xiao sean
Ranch Hand

Joined: Aug 20, 2007
Posts: 44
Originally posted by Jeanne Boyarsky:
What are you stuck on? Compiling? A runtime error? How to implement something specific?




hi, thanks for reply.
i sort of struck on the else statement after i change the code. (!c==d) eror in compile " else without if

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Looking at the code with some indentation, we have:


For the snippet you are asking about, we have:


The compiler reads this as:
- if c does not equal d, set status to false
- in a separate (redundant) block, set text to correct id
- else - wait, what else? There was no if. Well, there was one, but it was a whole step ago.

Basically the problem is that your { is only line later than you intend it to be.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GUI with constructor
 
Similar Threads
JDesktopPane - reference JInternalFrame
Problem with GUI
please can someone help me password my Java program!
Accessing JFrame contents
Getting information into a JTable from a drawing Canvas