• Post Reply Bookmark Topic Watch Topic
  • New Topic

image in a frame..  RSS feed

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
can anyone tell me how to insert an image at a desired position in simple frame?i would really appreciate it.
regards
karan
 
Amit Agarwal
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. use a null layout by JFrame.getCoontentPane().setLayout(null)
2. create a JLabel with the image
3. set the bounds of the label with JLabel.setBounds(x,y,w,h)
4. add the label to the frame
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks amit,it worked...
regards
karan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!