Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java GUI

 
jianfeng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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!
 
Shashank Agarwal
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • 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.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • 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!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
jianfeng
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
name changed.

anyone can help me with the gui?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic