• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JText Overlaying an Image  RSS feed

 
Ranch Hand
Posts: 36
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I'm having trouble adding JTextArea in front of/overlaying an image.  When text is entered into the TextField, and the Update button is clicked, that text should appear in front of the background image. However, whenever I try to add it to the frame positioning it as BorderLayout.CENTER/TOP etc. the text is added above the image. When I have tried frame.add(textArea), the whole image won't display.

This is my code:

GUI Class:


ComponentImage class:

 
Caiz Austin
Ranch Hand
Posts: 36
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to this, the line:

Has the text overlaying the image as I would like, however it isn't the user's input text from the JTextArea- how do I access this?
 
Rancher
Posts: 2941
19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the point of this question.

You were given an answer yesterday when you asked the question: https://stackoverflow.com/questions/50132658/adding-jtextarea-in-front-of-image that showed how to paint the text area on top of the image, so the text would be as the user entered.

Now it seems like you want the text in two places?

First you have the user type the text in the text area and then you copy the text from the text are to the image?

Instead of posting the question in multiple forums ask a question the is clear and understandable.
 
Marshal
Posts: 60163
188
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Camick wrote:. . . You were given an answer yesterday . . .  ask a question the is clear and understandable.

Good point. Please look at this. People on both fora need to know about your multiple questions.
 
Caiz Austin
Ranch Hand
Posts: 36
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell, sorry I didn't know about this but thank you for linking this page!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!