[415] in java-interest

home help back first fref pref prev next nref lref last post

scrollbar etc

daemon@ATHENA.MIT.EDU (Lein Ton)
Tue Jun 20 17:44:17 1995

Date: Tue, 20 Jun 1995 16:44:13 -0400
From: ton@cc.gatech.edu (Lein Ton)
To: java-interest@java.sun.com

Hi, 

my original problem was that if you add a Button and a Window to the hotjava browser-
window telling an applet at initialization time:

	Window aWindow = new WindowClass(item.parent);
	Button aButton = new Button("press me" ,"", item.parent);

the button moves when the hotjava scrollbar is used, and the window doesn't.

So I started looking around a bit, and finally it seems I don't understand much of
what happens anymore.

So here are a couple of questions:
- how can I add a scrollbar to a window, so that I can scroll through it.
- how can I draw a line on a graphics-thing.
- what does the sticky variable in the Window class represent.

Underneath you can find a small program that shows some things I tried.

Please have fun with it...

Lein Ton

import java.io.*;
import java.util.*;
import awt.*;

class Test {
 
   public static void main (String args[]) {
	WServer ws = new WServer();
	ws.start();
	Frame fr = new Frame(ws,false,null,400,400,Color.gray);
 	fr.setTitle("work you yerk");

	DisplayItemWindow win = new DisplayItemWindow(fr,"Window");
  
	Scrollbar sb = new Scrollbar(win, "sbName", Scrollbar.VERTICAL, true);
	sb.setScrollTarget(win);
	win.setScrollbar(sb);
	win.updateScrollbar();

 	win.graphics.SetColor(Color.red); 
     
	win.graphics.drawLine(10,10,100,100);
	win.drawLine(10,10,100,100);

	sb.map();
	win.map();
        fr.map();		
    }
}




-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post