thread obtains the event source component from the paint event, and calls the update method of the component after the system applies for graphical device resources. Update is a product left behind by the AWT era. It is intended that the AWT component draws the background of the component and then calls the paint method to draw the foreground of the component. After swing appears, this method is discarded, and all logic is transferred to the painting method. Update simply calls the paint method
Javax. swing. JComponent call sequence, javax. swing
I found it useful and recorded it online.
Http://bbs.csdn.net/topics/310041707
Java swing feels complicated ............ I don't want to use it at all, but I want to use it for my job >_
Javax. swing. JComponent classRepaint () calls update ()Update () call paint ()Paint () calls paintComponent (), paintBorder
During Java swing programming, you often need to handle keyboard events, such as handling shortcuts. Here's how to define keyboard events, and how to handle these events.
In jdk1.2, different methods of handling keyboard events are tailored to the objects of the JComponent and text classes: In JComponent, the Registerkeyboardaction method is defined and used to
Java tutorial translation Sequence Java Introduction Build a JSE development environment-install JDK and eclipse Language basics Java Hello World Program Analysis Variable Java Variables Java Native type Conversion of Java
During Java swing programming, you often need to handle Keyboard Events, such as shortcut keys. This section describes how to define Keyboard Events and how to handle these events.
In jdk1.2, different keyboard event handling methods are customized for jcomponent and text objects: In jcomponent, The registerkeyboardaction method is defined, this method is used to
project. In this paradox, the simple and efficient AWT is certainly the first choice for embedded Java.2 in ordinary pc-based or workstation-standard Java applications, the limitations that hardware resources impose on applications are often not key elements of the project. So in the standard version of Java, Swing is advocated, that is, to implement the applica
Java Interface Programming-create a simple framework for drawing graphics, java graphics
Introduction: Three. java files are used in total to build a simple interface programming framework.
1st files: NotHelloWorldComponent. java
// NotHelloWorldComponent. java1 import java.
of the subclass return value class. Starting with jdk1.5, the return value when overriding a parent class method can be the same as the parent class, or it can be a subclass of the parent class public JButton doSomething2 () {return null;} Error, the return value of the parent class is jcomponent, the subclass return value type is int, the subclass return value differs from the parent class return value type, and is not a subclass of the parent class
hateful thing is that the complicated interface compilation workload is huge. I have written over 3000 lines of swing interfaces, and I feel that the user experience is not so good. More than 6000 lines have been written recently. As there are more functional modules, the overall effect is just as general. The most profound word is: tired! As a result, swing is not widely used in real-world projects, and too many interface technologies can replace it. I was forced to write this article, but no
Convert a string in the format of "yyyy-mm-dd" to Java. SQL. Date:
Simpledateformat bartdateformat = new simpledateformat ("yyyy-mm-dd "); String datestringtoparse = "2007-7-12 "; Try { Java. util. Date = bartdateformat. parse (datestringtoparse ); Java. SQL. Date sqldate = new java. SQL. date (date. gettime ());S
container Revalidate method (This method is JComponent class method) This method will recalculate the size and layout of each component within the container, However, if you want to recalculate the size of all components in the JFrame (frame), you should use the name validate method, because JFrame does not inherit from the JComponent class
Using SetText (String), this method is defined in the JTextCompo
all other programs running on the Java platform, a swing program can create additional threads and thread pools, which require the methods that are introduced in this article. This article will introduce the above three kinds of threads. The discussion of worker threads will involve the use of the Javax.swing.SwingWorker class. This class has many useful features, including communication and collaboration between worker thread tasks and other thread
jcomponent can settooltiptext set ToolTips, for JTabbedPane can set settooltiptextat for each label or provide corresponding parameters when AddTab For JTable and JTree available cell renderer implementations, the renderer is jcomponent, call function Settooltiptext on it, or overwrite Gettooltiptext (MouseEvent), navigate to the column position, Return the generated hints, for custom components can inheri
GUI so that they could be displayed properly on all platforms. However, it is regrettable that the AWT produces a graphical user interface that is equally poor in every system, and JAVA1.2 adds the Java base class (JFC) to the old java1.0 AWT, which is part of a GUI called "Swing". Swing is the second generation of GUI development toolset, and AWT uses a specific platform-related implementation, while most swing components are not. Swing is a set of
designed to allow programmers to build a common GUI so that it can be properly displayed on all platforms. However, it is a pity that AWT produces graphical user interfaces that are equally inadequate in the view of various systems. JAVA1.2 adds a Java basic class (JFC) to the old java1.0 AWT ), this is part of a GUI called "Swing. Swing is the second generation of GUI development tool set. AWT uses implementations related to specific platforms, but
number -- communication window 54919.1.3 network, IP address and port number 55119.2 Java TCP programming 55119.2.1 data transmission protocol 55219.2.2 TCP Data Transmission Mode 55219.2.3 first TCP applet 55319.3 Java UDP programming 55719.3.1 UDP data transmission mode 55719.3.2 use UDP protocol to send and receive data 55819.3.3 Difference Between TCP and UDP 56019.4 conclusion: extend the program to 5
optional entry, but allows the user to select several different entries in a 628 Part 3 Java Software development Technology drop-down list. Users can also type selections within a text fieldImport java.awt.*;import java.awt.event.*;import javax.swing.*;/* Additemlistener itemstatechanged (ItemEvent IE) {String s = (string) ie.getitem (); Jl.seticon (new ImageIcon (S + ". gif")); 7) Options PaneThe options pane is encapsulated as a JTabbedPane class
GUI so that they could be displayed properly on all platforms. However, it is regrettable that the AWT produces a graphical user interface that is equally poor in every system, and JAVA1.2 adds the Java base class (JFC) to the old java1.0 AWT, which is part of a GUI called "Swing". Swing is the second generation of GUI development toolset, and AWT uses a specific platform-related implementation, while most swing components are not. Swing is a set of
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.