• 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

Text boxes over an image

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, just wondering if it is possible to have an image and to use text boxes to label different areas of the picture? Where the items are labeled is where I would like to put the boxes so I could type in the answer myself for testing purposes. I have attached the jpg.

This is the code I have so far that loads the image.
shaft.jpg
[Thumbnail for shaft.jpg]
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

use text boxes to label different areas of the picture?



I don't know what a "text box" is. Anyway I would use a JLabel since you want to display a label. You can add any component to a label. The basic code would be:



You will need to experiment with the location to position the label where you want it.
 
Kevin Corre
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry maybe I didn't explain it right. I want to be able to type in the name of whatever the lines are pointing to in the picture. thought I was calling it by the right term when I said text box, just want a field where I can type in hub or shaft or hilt or whatever the term may be for the item. The names will not be above them so I can test myself on the different terms. With your example you are putting the label there as if it were in the picture, think of the picture as not having the names there and I want to type what they are in a field. Hope that is clearer.

Kevin
 
Kevin Corre
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok got it figured out from you post this is what I was looking for, of course the names wont be left under the boxes. Thanks for the try anyways.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic