613614615616617618619620621622623
c.gridx = 1; c.gridy = 1; c.insets = new Insets(10, 0, 0, 0); f.add(bp4, c); f.pack(); f.setBounds(0, 0, 1000, 600); f.setVisible(true); try { bean1.loadFromURL("private:factory/swriter", null); bean2.loadFromURL("private:factory/swriter", null);
277278279280281282283284285286287
} private static class AWT { public static void loadJAWT(String name) { Frame f = new Frame(name); f.pack(); try { // FIXME: this works as a test, but fails in ShapedWindowDemo // if the JAWT load workaround is not used Native.getWindowPointer(f); }
7475767778798081828384
public void windowClosing(WindowEvent event) { frame.dispose(); } }); //frame.getContentPane().add(new GlyphPanel(maxCharBounds)); frame.pack(); frame.setSize(500, 500); frame.add(new Component() { public void paint(Graphics g) { System.out.println("Paint"); g.setColor(Color.RED);
6162636465666768697071
else { f = new Frame(); f.add(c); } f.pack(); f.setVisible(true); // Print instructions and expected results on console. System.out.println("===================================================="); System.out.print("This is a test that needs human interaction. Please ");
5657585960616263646566
Canvas c = new Canvas(); c.setBackground(Color.blue); c.setSize(100,100); add(c); f.add(this); f.pack(); f.show(); Point loc = f.getLocationOnScreen(); Rectangle bounds = c.getBounds(); Insets i = f.getInsets(); bounds.x += i.left + loc.x;
135136137138139140141142143144145
MenuBar mb = new MenuBar(); Menu m = new Menu("Menu 1"); mb.add(m); f.setMenuBar(mb); f.add(new Button("Button")); f.pack(); MenuItem itemA = new MenuItem("Item A"); m.insert(itemA, 0); MenuItem itemB = new MenuItem("Item B"); m.insert(itemB, 0); MenuItem itemC = new MenuItem("Item C");
230231232233234235236237238239240
a.add(c); a.add(l); c.setSize(100,100); f.add(a); f.pack(); f.show(); harness.check(a.isShowing(), true); harness.check(c.isShowing(), true); harness.check(l.isShowing(), true); harness.check(f.isShowing(), true);
5455565758596061626364
Frame f = new Frame(); Label c = new Label("label"); c.setBackground(Color.blue); add(c); f.add(this); f.pack(); f.show(); Point loc = f.getLocationOnScreen(); Rectangle bounds = c.getBounds(); Insets i = f.getInsets(); bounds.x += loc.x + i.left;
5253545556575859606162
setBackground(Color.red); Frame f = new Frame(); ScrollPane c = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS); add(c); f.add(this); f.pack(); f.show(); Rectangle bounds = c.getBounds(); Insets i = f.getInsets(); Point loc = f.getLocationOnScreen(); loc.x += i.left + bounds.x;