JavaWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JavaWorld@TW » Java SE 討論區  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 請問JTabbedPane..
redbug





發文: 44
積分: 0
於 2006-11-22 16:38 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
請問JTabbedPane 的API中有哪個method(),
可以取得目前被選取的tab是哪一個呢?



我是希望
使用者選取Agent tab時,在畫布上按左鍵就可畫出Agent.
使用者選取Goal tab時,畫布上按左鍵就可畫出Goal.
(畫布在另一個frame中)
所以希望知道有沒有method() 可以取得activeTab or CurrentTab,
請前輩提示一下,謝謝.


vote up 0 vote down
reply to postreply to post
作者 Re:請問JTabbedPane.. [Re:redbug]
Duncan

街友 JaJa

版主

發文: 7594
積分: 39
於 2006-11-22 16:53 user profilesend a private message to usersend email to Duncanreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
redbug wrote:
請問JTabbedPane 的API中有哪個method(),
可以取得目前被選取的tab是哪一個呢?

我是希望
使用者選取Agent tab時,在畫布上按左鍵就可畫出Agent.
使用者選取Goal tab時,畫布上按左鍵就可畫出Goal.

(畫布在另一個frame中)
所以希望知道有沒有method() 可以取得activeTab or CurrentTab,
請前輩提示一下,謝謝.


要做到這功能,不需要知道目前 user 選取了哪一個 tab,因為不同的 tab 放置不同的元件。

元件本身可以各自有自己對應 mouse operation 的處理方式。


vote up 0 vote down
reply to postreply to post

給我
貓咪 其餘免談

我要效法葛屁老師,我承認了,我是蘿莉控。
作者 Re:請問JTabbedPane.. [Re:redbug]
xio





發文: 58
積分: 1
於 2006-11-22 17:24 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
JTabbedPane.getModel() .getSelectedIndex()
返回的是当前选的tab的index号码。


vote up 0 vote down
reply to postreply to post
作者 Re:請問JTabbedPane.. [Re:redbug]
redbug





發文: 44
積分: 0
於 2006-11-22 21:43 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
感謝,可以work了 ...^^

vote up 0 vote down
reply to postreply to post

» JavaWorld@TW »  Java SE 討論區

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JavaWorld@TW


Powered by Powerful JuteForum® Version Jute 1.5.8
Copyright© 2002-2003 Rainman Zhu,Zua,Netboy,Scott. All Rights Reserved.