Results 1 to 3 of 3
  1. #1
    g6pd is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default Helo with Graphics

    hello,
    I want to send a string to the method paint from the main
    Java Code:
    class Board extends JFrame
    {
    public void showTurn(Graphics g,String playerName)
    {}}
    inside the method I want to draw the string, but I don't know how to send both of the variables to the method..(Don't know how to send the Graphics g).
    Thanks :)

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    The following tutorial might help: Trail: 2D Graphics (The Java™ Tutorials)

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,298
    Rep Power
    20

    Default

    Also
    Lesson: Performing Custom Painting (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    Note that custom painting is NOT done in a JFrame but rather in a JComponent/JPanel that is added to the frame.

    db

Similar Threads

  1. Drawing a graphics onto another Graphics ?
    By Ziden in forum Java Applets
    Replies: 0
    Last Post: 01-08-2011, 07:30 PM
  2. Help me with graphics
    By 7oclock in forum New To Java
    Replies: 12
    Last Post: 04-04-2009, 11:20 PM
  3. Help with 2d graphics please
    By xbox_nutter in forum New To Java
    Replies: 0
    Last Post: 04-02-2009, 11:48 AM
  4. SWT Graphics Example
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 06-28-2008, 09:28 PM
  5. Graphics
    By Joe2003 in forum Advanced Java
    Replies: 1
    Last Post: 01-25-2008, 06:24 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
  •