Results 1 to 5 of 5
Thread: Help me!!!
- 03-28-2010, 11:12 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Help me!!!
i created a mdi application with this method :
protected void createFrame() {
MyInternalFrame frame = new MyInternalFrame();
multiWindow.add(frame);
frame.setVisible(true);
try {
frame.setSelected(true);
} catch (java.beans.PropertyVetoException e) {
}
}
class MyInternalFrame extends JInternalFrame {
static final int xPosition = 30, yPosition = 30;
public MyInternalFrame() {
super("Gpaint Shape #" + (++openFrameCount), false, // resizable
true, // closable
false, // maximizable
false);// iconifiable
setSize(300, 300);
// Set the window's location.
setLocation(xPosition * openFrameCount, yPosition
* openFrameCount);
}
and now i want draw a line on active internalframe but i can't plz help me......
- 03-28-2010, 12:24 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 03-28-2010, 12:46 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
wrong
thank you but you'r method is wrong
i found new method
MyJPanel panel = new MyJPanel(); // create new panel
frame.add( panel, BorderLayout.CENTER ); // add panel
....
.....
......
.......
public MyJPanel()
{ public void paintComponent( Graphics g )
{
super.paintComponent( g );
g.DrawLine(0,0,20,20);
}
}
**** you can't use internalframe.getcontentpane().add(); it's wrong
- 03-28-2010, 01:08 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
-


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks