• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Copying Output Text

 
Ranch Hand
Posts: 93
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there people,i built a program which involves me printing a text as output to the user but i want the user to be able to copy that text but using JOptionPane.ShowMessageDialog doesn't do that for me.Is there a way to fix this?Thanks in advance!
 
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

It would definitely help if you'd show what you tried, otherwise would be quite difficult to guess where you did mistake (if any).
Also would help if you'd tell what you were expecting and what actual experience you had, so we could understand what you want.
 
stelios papamichael
Ranch Hand
Posts: 93
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my code: i am doing something like an encryption program so i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it:

 
Liutauras Vilda
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

stelios papamichael wrote:...i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it..


Please give an example, don't understand it.
 
stelios papamichael
Ranch Hand
Posts: 93
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:

stelios papamichael wrote:...i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it..


Please give an example, don't understand it.



I mean if you run it, an encrypted text will be displayed.The problem is that you cannot highlight it by clicking and dragging on it in order to copy that text!
 
Liutauras Vilda
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, sorry for not understanding right away.

Try similar to this approach:
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or what about just:
 
stelios papamichael
Ranch Hand
Posts: 93
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:Ah, sorry for not understanding right away.

Try similar to this approach:



This is amazing and was just what i was looking for thanks so much!
 
Liutauras Vilda
Marshal
Posts: 8842
631
Mac OS X VI Editor BSD Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're most welcome
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic