0
我在someFrame
中實例化了somePanel1
,somePanel2
和somePanel3
。跨JFrame中的多個JPanel的DrawString
如果我做了drawString
在somePanel
形式,我怎樣才能在somePanel1
,somePanel2
和somePanel3
輸出有所不同。
例如g.drawString("X", x, y);
在全部三個somePanel
s中都放置了X
。我如何獲得:
somePanel1
輸出X
,somePanel2
輸出Y
,並且somePanel3
輸出Z
?
這幾乎是我有什麼。我想我真正要問的是如何「實例化傳遞'X','Y','Z'」? – 2013-03-10 17:44:33
對不起,但是,某些Panel1是以someFrame的形式自動創建的... 'private main somePanel somePanel1;' 所以我不能在somePane窗體中使用它。如果我使用 'somePanel1 =新SomePanel( 「X」);在someFrame' 我得到一個無法找到符號錯誤 – 2013-03-10 18:03:34
我的意思是'私人Main.somePanel somePanel1;' – 2013-03-10 18:10:32