This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Java GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java GUI" Watch "Java GUI" New topic

Java GUI


Joined: Aug 14, 2004
Posts: 3
Hi, I just started learning java not too long ago. Now I am trying to get familiar with the GUI. I tried writing some codes for MasterMind game. But I need help in displaying the images.

Because I cant attatched any files here, please download it from

I wish to know how do I draw a circle on the board, and how to display a image on the board.

Thanks in advance!
Shashank Agarwal
Ranch Hand

Joined: May 20, 2004
Posts: 105
Code to draw a circle -

Here, the first two arguments indicate the X & Y co-ordinate, whereas, the last two indicate the width and height respectively.

Code to draw an image -

here 5 and 5 indicate the X and Y Co ordinate respectively.
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Welcome to JavaRanch, Bre@dpiG.

Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.


"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Swing / JFC / AWT forum...

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]

Joined: Aug 14, 2004
Posts: 3
how do i change my name? i can only change display name in my profile...

yah i tried to use drawoval etc but cant work. not sure why.

i have a container. the container has 2 panels. panel A is for some jlabel to display images of a mastermind board. pabel B is to display some color seeds. i want to draw some circles or display the seeds images to represent seeds on panel A but cant. how do i do it?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Originally posted by Bre@dpiG:
how do i change my name? i can only change display name in my profile...

Your display name is what needs to be changed.

GenRocket - Experts at Building Test Data

Joined: Aug 14, 2004
Posts: 3
name changed.

anyone can help me with the gui?
Have you checked out Aspose?
subject: Java GUI
It's not a secret anymore!