• Post Reply Bookmark Topic Watch Topic
  • New Topic

Copying Output Text  RSS feed

 
Ranch Hand
Posts: 93
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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!
 
Sheriff
Posts: 4930
334
BSD
  • Mark post as helpful
  • send pies
  • 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
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 4930
334
BSD
  • Mark post as helpful
  • send pies
  • 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
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 4930
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, sorry for not understanding right away.

Try similar to this approach:
 
Sheriff
Posts: 4289
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or what about just:
 
stelios papamichael
Ranch Hand
Posts: 93
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 4930
334
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're most welcome
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!