Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can you resolve these questions?Thanks.

 
cat cater
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How to draw a line link from a selected item of JList to other selected item of JList in JDesktopPane?
2. is JDesktopPane able scroll? if yes , How to write code?

thanks.

----cat


---------------------------------------------------
love you.if you are g
 
cat cater
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
like PowerBuild's DataWindow
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the scrolling, just add everything to a JPanel, add that to a JScrollPane, and add the scrollpane to your JDesktopPane.

Sounds to me like you're writing some kind of diagramming tool; if you, perhaps you could check out JGraph (www.jgraph.com). I hear it is supposed to be useful for creating that kind of thing.
 
cat cater
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First,thank you Stuart Gray.
now,many JInternalFrame in JDesktopPane,and not other components.
I try to add JScrollPane to JDesktopPane, but the JInternalFrame does'n visible in JDesktopPane.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try calling moveToFront() on one of the JInternalFrames. If that doesn't work, the solution might be to make another JInternalFrame for your scrolling area, and then resize that as appropriate. Not ideal, but it might be the only way.
 
cat cater
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh,I made a mistake . I should add JDesktopPane to JScrollPane,and resize JDesktopPane's size.

----code----
JDesktopPane.setPreferredSize(new Dimension(0,2000));
JDesktopPane.validate();
------------------------------------------------------
well,but it doesnot autoscroll. somebody tell me use "implements Scrollable".
find help.

!@_@!


-----cat
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really? I'm a bit surprised by that, but glad it works
 
cat cater
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. How to draw a line link from a selected item of JList to other selected item of JList in JDesktopPane?
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic