Section 3 swing
Returned directory
The jfc (Java foundation classes), proposed at the 1997 javaone conference and released in May 1998, contains a new Java window Development Kit named swing. These new GUI components are upgraded to AWT (appreciable) and seem to be very helpful for Java to occupy the computer world. The era of Java is approaching: downloadable applets will be software in the future; people
When I saw the applets and swing, I thought of WinForm, and all the so-called components in the Java beans package, all so familiar.Swing is an extension of AWT, which provides a more powerful and flexible collection of components. In addition to the components we already know, such as buttons, checkboxes, and labels, swing also includes many new components, such as palettes, scrolling windows, trees, and t
Self-
Day line
1. Preface:
when we have learned the basic syntax in Java, and familiar with the Java Object-oriented Foundation, we can start a simple swing program design, the use of VB Friends may be its simple design user interface approach to attract, just drag a few controls to the form, Writing an event for each empty piece can be a simple interface design. But the powerful Java is no better than VB? You can also design a beautiful interfac
Five common la s of Swing and wing in java
1. Border layout (BorderLayout)
2. FlowLayout)
3. GridLayout)
4. BoxLaYout)
5. Empty layout (null)
There are two other layout S: GridBagLayout (grid package layout) and CardLayout (card layout)
Note: The default layout of JFrame and JDialog is BorderLayout, while that of JPanel and Applet is FlowLayout.
Sample Code for border layout:
Import java. awt. borderLayout; import javax.
Swing is a powerful GUI toolkit that can be scaled, configurable, and Cross-platform. But Swing's flexibility is both a major advantage and a major weakness. Swing can build the same UI in different ways. For example, you can place an interval between GUI components using inserts, a blank border, or a fill. With too many Swing options, understanding the existing
Objective
Swing is a development toolkit for developing the Java application user interface. It is based on the abstract Window Kit (AWT) to enable Cross-platform applications to use any pluggable styling. Swing developers can use the rich, flexible features and modular components of swing to create elegant user interfaces with little code.
2.2 multi-threaded Swing event processingTo improve its efficiency and reduce its complexity, all Swing components are designed to be non-thread-safe. Although this sounds scary, it simply means that all access to the Swing component needs to be completed by a single thread-the event distribution thread. If we are not sure that we are located in a specific thread
I have been paying attention to the development of javafx since July December.
Now, it's almost the fifth year. During this period, I experienced some turbulence, but javafx was still developing and had undergone many changes (this is also a feature of Java technology, it won't be like Microsoft's abandonment of technology and frequent upgrades). From the pure javafx scripting language that used to adapt to the development of rich Internet technology, it has now become a technology completely u
Before introducing the swing threading mechanism, let's introduce some background concepts.Background conceptsynchronous vs. asynchronous :synchronization is when a program starts processing an event after initiating a request, waits for the result of processing, or waits for the request to complete before the program is blocked (block) until the request is completed.asynchronous is returned immediately after the current program initiates the request,
Swing
Chromiun-Based Swing componentsHttp://www.teamdev.com/jxbrowser
The way swing uses JavaFXHttp://www.tuicool.com/articles/N7J3auHttp://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm
DJ nativeswingVery powerful, can use IE, Firefox, xulrunner or Webkit-http://gongqi.iteye.com/blog/754231-http://sourceforge.net/projects/djproject/A few l
An insensitive graphical user interface lowers the usability of your application. When the following occurs, we usually say that the user interface is not responsive.
The phenomenon of not responding to events;
There is no renewal of the phenomenon;
These phenomena are largely related to the way events are handled, and when writing swing applications, we almost certainly have to write a method to respond to the mouse click button, keyboard return,
drawn. When the header is drawn, the row value is-1Column-column index of the cell to be drawn
Import COM. jtextfield. test. uppercasefield; import Java. AWT. borderlayout; import Java. AWT. color; import Java. AWT. component; import javax. swing. jframe; import javax. swing. jscrollpane; import javax. swing. jtable; import javax.
Substance look feelThe purpose of this project is to provide a popular look feel ). This appearance (look feel) combines the best features of Windows XP and MACOs 10.4 and requires JDK 5.0 and later.
More information about substance look feelJgoodies look feel jgoodies look feels make your swing applications and applets look more beautiful. The screen is as follows:
More information about jgoodies look feelThe screen of smooth metal look fe
Swing is non-thread-safe. That is to say, if multiple threads operate on a swing component at the same time, exceptions and other problems may occur.ProgramCrash. After all, repainting is a relatively time-consuming operation. If the content of a swing component is changed during the repainting process, the repainting content is inconsistent with the modified con
Applicable environment: when the user changes, other objects are notified, and other objects are changed. For example, for paging programs in swing, When you click the next page on the previous page, you need to re-activate the event and obtain new data from the database.
In Swing event processing, if multithreading is not used, the main interface is blocked, that is, the interface is white, when multithrea
Features of Java swing components:
1. The implementation of swing is a small GUI framework, which has no basic platform dependencies, but is dependent on AWT implementations.
2. The javax. Swing. jcomponent class is the base class of all swing components.
3. The objective of the sw
ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("Text: " + textField.getText()); } }); frame.add(panel, BorderLayout.NORTH); frame.setSize(300, 100); frame.setVisible(true); } }
Example 4: during development, you can only enter the format you want to control in the text box. For example, you can only enter numbers, letters, and other similar requirements. There are two implementation methods for this requirement, one is t
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.