• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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: 3034
22
  • 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: 64179
215
  • 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!
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!