Although possible, using absolute positioning of components (not using a layout manager) will result on interfaces that wont work on all platforms. This is because the size anfd apperance of componmets in the applet is dependant on the resolution and platform on which the browser is running.
the layout managers provided in Java are:
| Grid | Places components in a regular array. | ||
|---|---|---|---|
| GridBag | Places components in a regular array like the Grid above, but each component can also span rows amd columns | ||
| Border | positively wierd | ||
| Flow | only useful for interfaces with no design. | ||
| Card | Press on the buttons at the top of the card to see a CardLayout in action. Useful for complex user interfaces. Can be used to build tabbed components. | ||
| Button | Checkbox | Choice |
|---|---|---|
| Label | List | Scrollbar |
| TextArea | TextField | |
Later I will discuss the writing of custom components. The applets in the examples above are really the same applet that takes different parameters. The source can be found in the file WidgetDemo.java
| Panel | Frame | Dialog |
|---|---|---|
| panels are used to contain other componenets. See the examples on layout managers above to see how panels are used |
Applets are embedded in browsers and so do not have a frame, however there is no reason that applets can't create frames. |
Dialogs can only be started from a frame. |
| MenuBar | MenuItem | CheckboxMenuItem |
|---|---|---|
See also:
| file: /Techref/language/JAVA/nosugar/ui/index.htm, 6KB, , updated: 1996/10/10 11:15, local time: 2012/5/23 06:57,
38.107.179.231:LOG IN |
| ©2012 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://www.piclist.com/tecHREF/language/JAVA/nosugar/ui/index.htm"> Learning Java [ui]</A> |
| Did you find what you needed? |
|
|
Robotics nuts!Check out http://users.frii.com/dlc/robotics/projects/botproj.htm from Dennis Clark. This guy ROCKS! He has made (and sells but also releases code, docs, etc...) for a number of cool little robotic modules including whiskers, IR proximity detect and remote control, Sonar proximity detect, PWM, Servo, compass. Most of these use the little PIC 12C508 controller which costs basically nothing and is soooo tiny.The 4 servos, 2400 baud serial servo controller is a wonder of magic and he sells the programmed chip for $8. Wow! |
.