This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes can you resolve these questions?Thanks. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "can you resolve these questions?Thanks." Watch "can you resolve these questions?Thanks." New topic
Author

can you resolve these questions?Thanks.

cat cater
Ranch Hand

Joined: Jun 06, 2005
Posts: 39
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

Joined: Jun 06, 2005
Posts: 39
like PowerBuild's DataWindow
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
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

Joined: Jun 06, 2005
Posts: 39
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

Joined: Apr 21, 2005
Posts: 410
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

Joined: Jun 06, 2005
Posts: 39
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

Joined: Apr 21, 2005
Posts: 410
Really? I'm a bit surprised by that, but glad it works
cat cater
Ranch Hand

Joined: Jun 06, 2005
Posts: 39
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

Joined: Jan 14, 2004
Posts: 1535
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: can you resolve these questions?Thanks.