Results 1 to 2 of 2

Thread: Graphics

  1. #1
    feniger is offline Member
    Join Date
    Dec 2007
    Rep Power

    Default Graphics

    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...

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Rep Power


    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.

Similar Threads

  1. Classes in graphics
    By CyberFrog in forum New To Java
    Replies: 0
    Last Post: 04-02-2008, 09:11 PM
  2. Graphics
    By Joe2003 in forum Advanced Java
    Replies: 1
    Last Post: 01-25-2008, 06:24 PM
  3. graphics
    By Joe2003 in forum Advanced Java
    Replies: 4
    Last Post: 01-18-2008, 07:44 PM
  4. Adding graphics to array
    By romina in forum Java 2D
    Replies: 1
    Last Post: 08-01-2007, 01:45 AM
  5. Updating Graphics
    By Greedful in forum Java 2D
    Replies: 2
    Last Post: 07-20-2007, 07:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts