aspose file tools*
The moose likes Beginning Java and the fly likes re focusing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "re focusing" Watch "re focusing" New topic
Author

re focusing

Hannah Maurphy
Greenhorn

Joined: May 29, 2004
Posts: 1
Hi guys at java ranch,
I'm currently studying java at RMIT, Victoria, Australia. And we are currently doing an in-class project which involves making a basic calculator with a menu bar, but every time i click on the menu bar and then try to use the calcultor buttons it wont work, my teacher says it has something to do with re focusing, or refreshing graphics, but nor i or my teacher can figure it out....could u please give me a hand?
Luv Han xoxoxox
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
I'd put a "System.out.println()" trace statement in your button's event handler.

If you still don't see anything, I'd write a small "hello world" type of program that just has a "public static void main()", puts up a frame, adds a button, and gives the button an event handler, and get that working.

Good luck .. PSM

PS:
"Focus" isn't necessarily the first thing I'd look at, but you can always write an event handler for window events and put a "println()" in that, too.

PPS:
If you're REALLY lucky, maybe your teacher will let you use a tool like Eclipse, Netbeans or JBuilder with GUI debuggers that let you step through the code instead...


Paul M. Santa Maria, SCJP
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Hannah!

Folks around here would likely be able to better offer advice if you were to post the code that you're working on.

When posting code, please be sure to surround the code with the [code] and [/code] UBB Tags. This will help to preserve the formatting of the code, thus making it easier to read and understand.

If your issue surrounds a GUI concern, our Swing / JFC / AWT forum is the best place for it.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: re focusing