• Post Reply Bookmark Topic Watch Topic
  • New Topic

JWindow and selecting text

 
Matti Poro
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't I select text in a text component when it's in a JWindow?

 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the method detail for the isFocusableWindow method in the Window api.
 
Matti Poro
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use window.setFocusableWindowState(true), window.isFocusableWindow() still returns false?

I can select the text if I use the constructor JWindow(JFrame frame) where frame is set visible. This has a drawback that the frame's icon is created in the task bar.
[ January 23, 2006: Message edited by: Matti Poro ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I can select the text if I use the constructor JWindow(JFrame frame) where
> frame is set visible. This has a drawback that the frame's icon is created
> in the task bar.

have another look at the api docs, there is another component that can be
the window's parent (this one doesn't create a taskbar icon)
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the past I found JWindow a bit of a headache to work with. If you want an undecorated window to work with (one with no title bar or border) why not try using a JFrame or JDialog with its.setUndecorated(true)?
 
Matti Poro
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have another look at the api docs, there is another component that can be
the window's parent (this one doesn't create a taskbar icon)


I only find constructors with Frame, Window and GraphicsConfiguration. For GraphicsConfiguration it says "This window will not be focusable." and Window needs another Window or Frame in its constructor.

In the past I found JWindow a bit of a headache to work with. If you want an undecorated window to work with (one with no title bar or border) why not try using a JFrame or JDialog with its.setUndecorated(true)?


Thanks. An undecorated JDialog is perfect.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be fair to Michael, I think he was hinting about the constructor JWindow(Window owner). But stop and recall:

JDialog extends Dialog extends Window

so you could pass a JDialog object to this constructor. That being said, I still find an undecorated JDialog/JFrame works for me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!