Witam, mam problem a mianowicie...
napsałem własne funkcje do rysowania- plik:GPI.java
class GPI extends JPanel{
.....
np. public void drawLine(int x0, int y0, int x1, int y1, Color color)
{}}
i teraz mam aplet za jkimis buttonami etc. GPTest.java
.....
GPI gp = new GPI(1500, 1500);
public void init() {
JFrame frame = new JFrame("cos tam");
GPTest demo = new GPTest();
demo.gp.drawCircle(100, 100, 50, Color.BLACK);
frame.getContentPane().add( demo, BorderLayout.CENTER );
frame.setVisible(true);
}
}
public void paint(Graphics arg0) {
super.paint(arg0);
arg0.drawImage(gp.getImage(), 0, 0, null);
}
....i tu pytanie jesli robie tak jak wyżej w nowym Frame to wyskakuje Applet osobno wyskakuje frame i wszystko działa ładnie :) ale ja chce to rysowac w applecie w kontretnym JPanelu probowalem np.
....
GPTest demo = new GPTest();
demo.gp.drawCircle(100, 100, 50, Color.BLACK);
jPanel2.and( demo ); //ale to nic nie daje panel pozostaje pusty jak to zrobic :)Byłbym wdzięczny :)