• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java GUI

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 http://nacz.net/mm.zip

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!
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Bre@dpiG.

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

Thanks!
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
jianfeng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
jianfeng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
name changed.

anyone can help me with the gui?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic