• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to convert Console App to GUI...

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need some examples of how to code a GUI input form for a console based application. I am in a time crunch which is why I am askin for examples at this time. I have been attempting (without great success) to go through the sun tutorials and some other text's as well and I have also pounded my head against the monitor going through the API, but I have to get this project done NOW and haven't coded in 2 years.

I'm just looking for examples, not asking for anyone to do it for me.

Thanks.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it depends entirely on how you want to get the data from the user:
textfield
listbox
combobox
etc

and on how you want to display the output:
label
textfield
textarea
etc

the 'processing' part of your program would probably remain the same

here's a very simple demo GUI


 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was looking for somthing that would "explain" how to hook a button and a textbox (or boxes), so this works great.

Thanks again!
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, still lost.. I am trying to create just a search page, calling the search function in another class. I'm having problems with the button...

This is the search class:


This is my pitiful excuse for GUI code..


Needless to say... HELP is greatly appreciated...
[ May 18, 2005: Message edited by: Sam Smoot ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you would be better off starting out small

by that I mean leave the db stuff till later
(assuming it performed correctly when used via a console)

here's your GUI with a simple search class - just to check
the feel and operation of the GUI.
whether its the db class or this simple class, the result
is the same - the return value from the method S4Ids(String passedID)

 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What?? Start Small??

I kept telling them to let me create a web application (ColdFusion) but they are too backwards to know better so I'm having to do it this way, and boy, is this a "Learning Experience".

Unfortunatetly, I have to use the data base portion.. I also have to incorporate the add part as well. They already work, and I have "stripped" them so that they can be called with passed values to update / search the database. My main problem is getting the value to the search class, etc.

I'm having problems getting the text from the srchTxt field into the argument for the search code. If I can just get that value passing correctly, I should be able to get the rest...

I've got this now..


The error I get is :

Cannot refer to a non-final variable srchTxt inside an inner class defined in a different method

Thanks for the help!
[ May 18, 2005: Message edited by: Sam Smoot ]
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Woah! This kinda fixed it.. (Eclipse is smarter than I thought..) :roll:

Changed the value of srchTxt to final.

Changed the button code to:


and got a result... Just have to work on the layout so that it shows up...


Thanks!
[ May 18, 2005: Message edited by: Sam Smoot ]
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It Works, but it's ugly.. Can anyone explain, help with a layout option?

I need to have the labels beside the textfields, but they are scattered. The labels acf2Lab and otisLab need to go above their respecive textfields. The line borders are not a part of the design, just somthing for me to see just what is actually going on. The blank label is supposed to be blank, but I put the + string in their to see if it was showing up, and it is, but only once...

SO CLOSE!!!


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
see if this is any closer

 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's much prettier than what I came up with.. I just had to increase the gridlayout by about 6 levels to get it all to "behave"....

One day I might actually know enough to be dangerous.... but for now, just clueless...
reply
    Bookmark Topic Watch Topic
  • New Topic