Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JText Overlaying an Image  RSS feed

 
Ranch Hand
Posts: 35
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: 35
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: 2895
17
  • 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: 58830
179
  • 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: 35
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!