Float Overview in View

I make a overview (JGoControl) in JGoView(JGoDocument) like a float dialog but i have 2 problem

1. add control to document use
// myOverviewComponent is overview JGoControl
select the overview control and move the control (mouse click and drag)
exception occured..

java.lang.InstantiationException: com.xxx.component.xxxDocument
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.nwoods.jgo.JGoView.dragGestureRecognized(Unknown Source)
at com.nwoods.jgo.JGoView.onDragGestureRecognized(Unknown Source)
at com.nwoods.jgo.JGoView$JGoViewCanvas.dragGestureRecognized(Unknown Source)
at java.awt.dnd.DragGestureRecognizer.fireDragGestureRecognized(Unknown Source)
at sun.awt.windows.WMouseDragGestureRecognizer.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
what's problem?
2. first problem make exception but working... ^^
second is a question..
i want overview dialog keep same position when document area(displayed in overview) draged
what can i do for this?
source code
// overViewComponent.java
public class overViewComponent extends JGoArea {

public overViewComponent() {

public void initialize(JGoView view) {
setSize(250, 300);


JGoRoundRect rrect = new JGoRoundRect();
rrect.setSpotLocation(Center, view.getCanvas().getSize().width/2, view.getCanvas().getSize().height/2);


JGoButton btn = new JGoButton();
btn.setSize(50, 21);
btn.setSpotLocation(TopRight, rrect, TopRight);

overViewControl over = new overViewControl();
over.setSize(getSize().width-5, getSize().height-(btn.getHeight()+2));
over.setSpotLocation(BottomCenter, rrect, BottomCenter);

class overViewControl extends JGoControl {
private JGoOverview myOverview = null;

public overViewControl() {

public JComponent createComponent(JGoView jGoView) {
myOverview = new JGoOverview();
return myOverview;
// linkDocument.java
public class linkDocument extends JGoDocument {
private linkView myLinkView = null;
public linkDocument(linkView view) {
myLinkView = view;
public JGoListPosition addObjectAtTail(JGoObject o) {
if(o instanceof overViewComponent) {
return super.addObjectAtTail(o);
return super.addObjectAtHead(o);
// linkView.java
public class linkView extends JGoView implements JGoViewListener, MouseWheelListener {

// make the overview window
protected overViewComponent myOverviewComponent = null;
private void overviewAction() {
if(myOverviewComponent == null) {
myOverviewComponent = new overViewComponent();
public void closeMyOverview() {
myOverviewComponent = null;

Thanks in advance ^^

Instead of displaying a JGoOverview by hosting it in a JGoControl in your JGoView, why not just add it to your JPanel or other container, in front of the JGoView?

i make java applet (run in web browser).
i want one view in browser (even overview)
why no use jdialog? because
i was created jdialog for overview.
when i running it, bottom of jdialog displayed "java applet viewer" look like status bar, i want not show this message
i use jdk 1.4.2.xx
when jdialog show, i can't handle it modal or Always On Top
it's look better. ^^;
so i make my choise to use JGoControl in JGoDocument
and get some problems T.T
can i solves my problem? ●█▀█▄

OK, I assume you are trying to display a JGoOverview in your application, and that you want the overview to be overlapped with the JGoView that the overview is observing/controlling.

I believe you don’t want to add the JGoOverview as a JComponent hosted by a JGoControl in your JGoDocument, because then it would be scrolled and zoomed along with the rest of the objects in your document.

One way to achieve this is by adding the JGoOverview to a panel by using absolute positioning (not using a Swing LayoutManager).

A similar way to do that is to add the JGoOverview to the JGoView itself. Change Demo1.java in the following manner:

[code] void overviewAction()
if (myOverview == null) {
myOverview = new JGoOverview();

  myView.getCanvas().add(myOverview, -1);
  myOverview.setBounds(0, 0, 120, 120);

  //myOverviewDialog = new JDialog((Frame)Demo1.getApp(), "Overview", false);
  //myOverviewDialog.getContentPane().setLayout(new BorderLayout());
  //myOverviewDialog.getContentPane().add(myOverview, BorderLayout.CENTER);

Note how the code no longer is using a separate JDialog window.

thank’s walter.

i make my overview component in JPanel (your recommend) and it's work good~
that's what i want
i thank you one more time for solve my problem.