2009年12月7日 星期一

Java 教學,學習筆記,解題步驟,填格子,

Java事件總表:
http://wkf.dyndns.org/myweb/event.htm
http://wkf001.110mb.com/myweb/event.htm
___________________________________________
字體的資料型態: int ,
___________________________________________
GUI是由Component,LayoutManager以及Listener所組成的。Component是畫面的主要組成成分,本身並沒有可見的實體,其子類別才有顯現的效果。如果Component可以放入其他的Component,則這種Component就稱為是Container。Container裡面的Component的排放位置,可以用絕對座標,也可以透過LayoutManager加以調整。

為了讓原先使用AWT的應用程式能改用Swing的程式庫, AWT內所有的元件都有相對應以J開頭的Swing元件, 如Button對應JButton, TextField對應JTextField。原先AWT的程式只要把Source Code裡面的AWT元件前面加上J即可, 其餘Event Handling和LayoutManager均可沿用(除了JFrame, JDialog, JApplet, JWindow等最上層的Container不能直接加入元件, 必須透過getContentPane()取得放置的地方)。

http://programming.im.ncnu.edu.tw/J_Chapter11.htm
______________________________________________________
列表選擇事件_類別 ListSelectionEvent
implements ListSelectionListener   實作介面
addListSelectionListener()

valueChanged(ListSelectionEvent e)
______________________________________________________
資料項事件_類別  ItemEvent
implement ItemListener
addItemListener()

itemStateChanged(ItemEvent e)

if (e.getStateChange()==ItemEvent.SELECTED)
______________________________________________________
滑鼠事件有7個方法:
一.
implements MouseListener
addMouseListener()

1.mouseClicked(MouseEvent e)
2.mousePressed(MouseEvent e)
3.mouseReleased(MouseEvent e)
4.mouseEntered(MouseEvent e)
5.mouseExited(MouseEvent e)

二.
implements MouseMotionListener 或 extends MouseMotionAdapter
addMouseMotionListener()

1.mouseDragged(MouseEvent e)
2.mouseMoved(MouseEvent e)
______________________________________________________
new:用來產生新的物件。後面必須跟著某個constructor, 以便進行初始化的動作。
Object產生時一定要呼叫的方法, 稱為Constructor(建構子)

http://programming.im.ncnu.edu.tw/J_Chapter2.htm
______________________________________________________
JAVA 反組譯 : DJ Java Decompiler

從 Tools => Decompile more files 可以一次反組譯某資料夾下的多個 bytecode。如果程式有包含中文字,記得要多選取一個選項「Convert Unicode strings to ANSI strings」,這樣中文就不會變成內碼。

http://zeroplex.blogspot.com/2009/07/java-bytecode.html

沒有留言:

張貼留言