Results 1 to 5 of 5
  1. #1
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default PopupMenu and JEditorPane String to Image conversion

    Hello all.
    I am working on a simple online chat program. I have build the server services and generally everything works smoothly.
    My chat GUI looks like the image above :

    PopupMenu and JEditorPane String to Image conversion-screenshot_1.png

    Now for the input area i use a JEditorPane as like the output message area. The reason of choosing JEditorPane is because i want to apply some CSS on future.(If you can to suggest anything better ok :) ).
    Now under the input message area there are two JButtons. One for attachments and other one for emoticons. Now i am trying to make a Popup Menu with all my Emoticons Images when someone click the JButton(emoticons). I was thinking about a JList inside a popupMenu but that kind of thing is mostly impossible i guess. So If anyone has any idea of how can i implement this thing then i would like to hear it. (something like emoticons list i this Forum and if someone know a free good resources(gifs or images) will be nice too)

    Also would be nice if someone can tell me a way to automaticaly convert String to images for example when someone type in inputJEditor something like this :) or this :( to convert it to emoticon image
    Last edited by ShadowWalker; 01-15-2015 at 11:41 AM.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: PopupMenu and JEditorPane String to Image conversion

    I would focus on one thing at a time, and thus ask one question at a time. Now you run a great risk of this thread turning into a minefield of disjointed answers and suggestions because different people will zoom in on different questions.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: PopupMenu and JEditorPane String to Image conversion

    Hmm i guess you have right..So i remove the Error message and the question about the error and i will make an onother post about that (maybe in advanced section)
    if again my post has too many and different questions then i will try to edit again.

    The main question actually is how to make a Menu with emoticons by pressing the emoticonsButton. I was thinking about a PopupMenu but i don't know how to implement it.
    Last edited by ShadowWalker; 01-15-2015 at 11:45 AM.

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: PopupMenu and JEditorPane String to Image conversion

    You know about the Swing tutorial I hope? It has an incredible amount of examples. There isn't a thing in the world that I wanted to do with Swing that I didn't figure out using it.

    Lesson: Using Swing Components (The Java‚„Ę Tutorials > Creating a GUI With JFC/Swing)

    The custom combo box example (a combo box with a custom renderer) might be a way to go for example:

    How to Use Combo Boxes (The Java‚„Ę Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    183
    Rep Power
    8

    Default Re: PopupMenu and JEditorPane String to Image conversion

    Hmmm interesting..i havent thought about JComboBox...Thx for the advice i will check it right now! :)

Similar Threads

  1. Image and Hyperlink issues (JEditorPane
    By cfc1252 in forum AWT / Swing
    Replies: 0
    Last Post: 09-14-2012, 05:42 PM
  2. conversion of image in to binary and text
    By Balasubrahmanyam in forum New To Java
    Replies: 9
    Last Post: 07-27-2011, 02:51 PM
  3. Conversion from BufferedImage to SWT Image
    By Jonah Bron in forum New To Java
    Replies: 1
    Last Post: 06-27-2011, 02:40 AM
  4. Replies: 2
    Last Post: 10-04-2010, 02:50 PM
  5. How to display image in JEditorPane
    By usccar in forum New To Java
    Replies: 1
    Last Post: 12-10-2009, 06:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •