)Mouseexited (MouseEvent)Mouseclicked (MouseEvent)
KeyEvent
Keyboard input
KeyListener
Keypressed (KeyEvent)Keyreleased (KeyEvent)Keytyped (KeyEvent)
FocusEvent
component receives or loses focus
Focuslistener
Focusgained (FocusEvent)Focuslost (FocusEvent)
AdjustmentEvent
Moved a component such as a scroll bar
Adjustmentlistener
Adjustmentv
When using tubro Linux, Many Commands need to be learned. Of course, some of these are very important. First, let's look at java awt Chinese processing in tubro Linux. I hope you will have some gains.
fontset.sansserif.bolditalic=\
-bh-lucida-bold-i-normal-snas-*-%d-*-*-p-*-iso8859-1,\
-misc-SimSun-medium-r-normal--*-%d-*-*-c-*-gbk-0
fontset.monospaced.plain=\
-bh-lucidatypewriter-medium-r-
A minesweeper game written with knowledge of the Java AWT interfaceDetailed annotations in the codePackage Com.langsin.saolei; Import Java.awt.Color; Import Java.awt.Font; Import Java.awt.Frame; Import Java.awt.Graphics; Import java.awt.GridLayout; Import Java.awt.Image; Import java.awt.Insets; Import Java.awt.Label; Import Java.awt.Menu; Import Java.awt.MenuBar; Import Java.awt.MenuItem; Import
("Prepare to close window ...");System.out.println ("closed");System.exit (0);}});Txf.addkeylistener (New Keyadapter () {/*** @parame keypressed Set keyboard listener events, set only 0 to 9 digits* You can delete a number using the DELETE key*/public void keypressed (KeyEvent e) {Set the obtained key number, which is stored in ASCIIint keycode = E.getkeycode ();if (! ( KeyCode >= keyevent.vk_0 keycode if (keycode! = keyevent.vk_back_space) {System.out.println (keycode + = = = Key ILLEGAL!!!!!
: Create a window with a menu, the width of the window and screen is the same, height is half the height of the screenThe following code:Importjava.awt.*;classFirstwindowextendsframe{MenuBar MenuBar; Menu menu; MenuItem item1,item2; Firstwindow (String s) {settitle (s); Toolkit Tool=Gettoolkit (); Dimension Dim=tool.getscreensize (); SetBounds (0,0,dim.width,dim.height/2); MenuBar=NewMenuBar (); Menu=NewMenu ("File"); Item1=NewMenuItem ("Open"); ITEM2=NewMenuItem ("Save"); Me
(1) Events (event): Describes the object in which an event occurs;
(2) event Source: event generator; (3) Event Handlers: Method for accepting event objects, interpreting event objects, and processing user interactions; (4) event model of jdk1.1; delegate model; event listener: class that implements the listener interface. A listener object is an instance of the class that implements the special listener interface;
The event sources and event handlers are separated;When the button event is tri
character, and the text box displays only the characters specified by the parameter C when the user makes text input in the text box(7) public void Seteditable (Boolean b)The text box object calls this method to set the editable nature of the text box(8) public void addActionListener (ActionListener l)The text box object calls this method to add an action monitor to the text box(9) public void Removeactionlistener (ActionListener l)The text box object calls this method to remove the action Moni
One benefit of the New AWT event model is flexibility. In the old model we were forced to write code hard for our program. But the new model we can invoke to add and delete event actions in a single method. The following example demonstrates this:
: Dynamicevents.java//The new Java 1.1 event model allows to//change event behavior dynamically.
Also//Demonstrates multiple actions for an event.
Import
Java-linked list source code principle analysis, and build a queue through the consumer list, java-linked list
Here we will introduce the simplest linked list listing;
Let's take a look at the add () method:
public boolean add(E e
Java (Article 3 and 2) ----- List summary, java ----- list Summary
Previously, LZ has fully introduced most of the knowledge about the List interface, such as ArrayList, List, Vector, and Stack. Through these knowledge points, we
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.