Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Embedding an image in textbox

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Location
    Chandler, Arizona, USA
    Posts
    25
    My Mood
    Devilish
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Embedding an image in textbox

    Is this even possible? I would like to make it so I can drag drop an image into a textbox . . .
    does anyone know of any tutorials or example code for this? Thanks in advance.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Embedding an image in textbox

    If a textbox is supposed to hold text, what will it do with an image? Show the image's filename?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Location
    Chandler, Arizona, USA
    Posts
    25
    My Mood
    Devilish
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Re: Embedding an image in textbox

    Microsoft word is an example of what you can do - drag-drop an image into it, and the image itself
    shows up within the text. That is what I would like to be able to do. I have been able to do that
    with a rich text box, (Microsoft Visual Basic), but I am wondering if Java has that capability.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Embedding an image in textbox

    I was thinking of the JTextArea class.
    I think the JTextPane class will display images and text. Have you tried that?
    If you don't understand my answer, don't ignore it, ask a question.

  5. The Following User Says Thank You to Norm For This Useful Post:

    Skywola (March 4th, 2014)

  6. #5
    Junior Member
    Join Date
    Oct 2013
    Location
    Chandler, Arizona, USA
    Posts
    25
    My Mood
    Devilish
    Thanks
    10
    Thanked 2 Times in 2 Posts

    Default Re: Embedding an image in textbox

    It looks like you are correct on that Norm . . .
    How to Use Editor Panes and Text Panes (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    Thanks, that really appears to be what I am looking for!

Similar Threads

  1. Help with embedding database
    By MrT in forum JDBC & Databases
    Replies: 5
    Last Post: November 26th, 2011, 07:32 AM
  2. Embedding a hyperlink within a JFrame
    By KiwiProg in forum AWT / Java Swing
    Replies: 1
    Last Post: January 3rd, 2011, 12:19 AM
  3. TextBox
    By tryingtoJava in forum AWT / Java Swing
    Replies: 3
    Last Post: October 7th, 2009, 10:05 AM
  4. make textbox in canvas
    By mahdi in forum Java ME (Mobile Edition)
    Replies: 2
    Last Post: October 6th, 2009, 07:10 AM
  5. Embedding images in a matrix.
    By Aims_ in forum Java Theory & Questions
    Replies: 1
    Last Post: September 11th, 2009, 02:37 PM

Tags for this Thread