Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me create this applet

 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, can someone give me a hand on creating this applet? I don't need it to do anything, I just need to make it look this way, the buttons don't do anything, I just need the design to be this way.
Can you please help me do it as I'm totaly new to applets.:


The program is divided into three panels (JPanel)

1. In the first section the user chooses the destinations, from where to where (JComboBox),
and he chooses the number of seats (JTextField).
He can also choose wether he is going to travel with a Bag or a Suitcase (JCheckBox).

2. In the second field, the user types his personal infos, name, surname, number of passport (JTextField).

3. In the third field, the user chooses one of the payment methods (JRadioButton).

The buying of the ticke is confirmed with the "Buy" button (JButton), or it's canceled with the "Quit" button.

 
Knute Snortum
Bartender
Pie
Posts: 2908
62
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ShowSomeEffort. What have you done so far? Have you read a tutorial? Post the code you have so for and UseCodeTags.
 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't even know where to start mate.. I've tried 100 tutorials, 100 videos, there has to be something NEW which doesn't make sense on them... soooooooo frustrated!
Can someone at least show me an example, so I know what to look for when learning?

 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bashkim Ukshini wrote:I don't even know where to start mate..

How about here.
It creates an applet that displays a label with the text Hello World, so all you need to do is update the run method to display your GUI.
That's all you need to know about Swing - the GUI is Swing programming.
Then you just need to read the next few sections of the tutorial to learn how to deploy the applet.
 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay guys, I've managed to make some progress but I need a hand..
I've written the first JPanel and the elements I need inside it, but they are appearing a bit unorganized.

This is how they are appearing right now:
http://prntscr.com/4z27be

And this is how I would like them to appear:
http://prntscr.com/4z27p9

Here is my curent code:
 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay guys, I believe I found my way to play around with the possitions of the items, but I need one last thing I believe... to add this line around my JPanel, exactly as shown in the picture:

http://prntscr.com/4z2rwc
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bashkim Ukshini wrote:to add this line around my JPanel, exactly as shown in the picture:

If you mean the line with Flight Options: embedded in it, that's a Border
 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to add the border too, now I can't seem to properly order the items like in the given example:



Instead, I'm getting this:
http://prntscr.com/4z3xje

Now matter which value I give to a specific item for the Y value (to move it further below) it doesn't affect it, it still stays just one line below the previous element.
I also can't make the elements start from the left, eventho they have values 0,0, their starting possition is this one:


This is my current code:
 
Kaspersky Ukshini
Ranch Hand
Posts: 122
C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This topic is solved. I found the solution.
For anyone else with the same problem, I used JPanels inside JPanels, and that did the job!


Thank you alL!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic