Results 1 to 4 of 4
  1. #1
    sunolinu is offline Member
    Join Date
    Jan 2010
    Posts
    15
    Rep Power
    0

    Default can any one help me about this GUI ?

    can any one help me about this GUI ?

    i want create widow that have two part one left one at right

    on the left panel i have some shape like fill circle and i have button and ...

    i want when user click on fill circle at left panle then click on right panel

    , exactly at just point fill circle be created and at right panle i whould be

    able to animate those shape now :

    i know i should use swing , awt , mouseListner and ...

    but i should use what component for left panel ? such as : JPanel or JLayeredPane or ... ?
    what i should to use component for right panel that i should be able to animate shape on it?
    how i should get coordinate of point at right panel that mouse clicked?
    and how create my shape that place at left panel on it?
    thanks

  2. #2
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    For the left panel I would use a Box with JButtons in it.
    For the right panel I would use a subclass of JPanel.
    Each button adds an entry to a list of shapes and calls repaint() on the JPanel.
    The JPanel subclass overrides the JPanel paintComponent() method.
    The method travels the list and paints each shape appropriately.
    A MouseListener attached to the JPanel subclass listens for mouse hits
    and mosifies the location of the item most recently added to the list of shapes.

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Start with a JSplitPane and add a JPanel to each. Add components to each JPanel. Look at Sun's Java Tutorial on Swing. Swing won't work if you don't do the basics correctly...

  4. #4
    sunolinu is offline Member
    Join Date
    Jan 2010
    Posts
    15
    Rep Power
    0

Posting Permissions

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