This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Dear All, how do you create the interface like this?
This is an elevator may go up and down to pick up or send the passenger. When the passenger presses a left button, say �F3�, the elevator goes up from F1. After it arrives, the passenger presses a right button, say �F7�, the elevator goes up and stops on F7. After then it checks whether there is any left button pressed. Assume that the initial position of the elevator is on the first floor (F1), and the display information about the elevator will be updated
This is what I think
I should have 4 panels in a Frame in GridLayout 1 on top as label panel 1 on the left as button panel outside the lift 1 on the right as button panel in the lift 1 which shows the location of the lift.
There's a problem which I cannot understand. How should I draw the line of every storey and make sure the line coincides with the buttons and every components are still in proportion when user max or min the applet??
If this is a Swing GUI, you can use the Border concept to draw those lines, particularly LineBorder.
Joined: May 25, 2005
hi Ulf Dittmer, where do you mean by Border concept? Are you saying that I should have 1 row of F8 , 1 row of F7...... each row has 3 columns?? All rows are added into a frame?
Joined: Mar 22, 2005
No, I was talking about the javax.swing.border package. But come to think about it, I would not use 4 panels, but only 2: one for the label, and one for all of the graphics. That way you will not have alignment problems.
I'm not at all thrilled to see that Craig's given a complete solution to what's obviously a homework problem. Craig, your code examples are often very helpful, but please consider whether letting the poster do some of the work themselves wouldn't be more helpful in the long run.
Suppose I have many panels. How can I call a component in a particular panel from another panel?
For example, I have a panel 1 with a Jbutton. I have another panel 2 with a JLabel. both panels are in different class. Is there a way to get JLabel object of panel 2 from panel 1 so that I can change the Label content?
Joined: Mar 22, 2005
This has nothing to do with applets any more, so I'm moving the thread to our GUI forum.