This semester in my university course (Object Oriented Programming at the University of Western Australia) our project was to make a component that was potentially saleable. My group made a component that took an xml file outlining a question database and returned an array of questions sorted according to a specification. That was easy. Now, I want to make this component into an application. While I have a knowledge of many of the concepts that surround java my coding experience is dismal. I need help in turning this (for my personal use - you're not doing my homework) into a vocabulary testing program that I can use for my Latin unit. I want to be able to feed in the Latin via XML and then be tested upon those words randomly. My component takes care of that up to the point of an array of question objects correnponding to each word. I have no idea where to begin with writing a gui and how an application is designed. Please, if you could halp me I would be most appreciative. Harry Wykman
Wow thats quite a broad request you have. First to create an application all you need is a class that has a main() method with the following signature:
The String args allows you to take input as parameters when you start the app at the command line with: >java LatinStuff firstParamter another etc or just >java LatinStuff Next to get a gui started in an app you probably want to create a Frame, add some components to it, give it a size and make it visible:
Of course eventually you will need things like listeners to close the gui, and classes to actually make stuff work, but this is the shell of an app. This what you wanted?
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Jul 19, 2001
That's good, thanks. The functionalitys that I want the gui to have are: displaying a question (vocab word - I think I can do this), taking an imput from a text field of some kind (I don't know how to do this) and checking it against the questions 'correct' field. Harry Wykman.
Harry, One good resource for learning how to make a GUI for your application is the Java Tutorial. They have a track that teaches you all the basics: Layout managers, event listeners, frames, etc. I suggest that you go through those on your own first and come back here if you have any specific questions. Good luck