Results 1 to 2 of 2
- 12-29-2007, 02:00 PM #1Member
- Join Date
- Dec 2007
- Rep Power
I am currently building a chessgame of player vs. player (no A.I.)
I am almost done with the logic (legel/illegal moves, etc..)
and I'd like to learn how to make a java applet/aplication,
I dont know the difference yet.
the Sun tutorials are packed with information all over the place, and beyond the basic tutorial it really spreads out to all directions, so its kind of hard to learn how to make an actual simple buttons, squares, lines applications there.
can anyone please guide me to focused tutorials on simple window building?have a good one - Day I mean...
- 12-29-2007, 05:22 PM #2
make an actual simple buttons, squares, lines applications there
In general terms you have two approaches:
1 — use components for your chess board, eg a GridLayout of JLabels or JPanels
2 — draw everything on a JPanel in the (overidden) paintComponent method.
Either way you can add your game to the center section of a BorderLayout in your JFrame or JApplet. For controls you have options: JMenus, JToolBar, or a JPanel with JButtons on it which can be added to the south section of the BorderLayout. The tutorial has a section on custom drawing/painting and also a trail on 2D Graphics if you like the drawing alternative. Sounds like you have found the rest of what you'll need there.
- By CyberFrog in forum New To JavaReplies: 0Last Post: 04-02-2008, 09:11 PM
- By Joe2003 in forum Advanced JavaReplies: 1Last Post: 01-25-2008, 07:24 PM
- By Joe2003 in forum Advanced JavaReplies: 4Last Post: 01-18-2008, 08:44 PM
- By romina in forum Java 2DReplies: 1Last Post: 08-01-2007, 01:45 AM
- By Greedful in forum Java 2DReplies: 2Last Post: 07-20-2007, 07:12 PM