Using GIF images to make simple animations is a common rendering technique, and swing supports GIF image formatting and can be animated automatically.
The simplest way to put a GIF picture on a swing component is to invoke the JButton or JLabel seticon (icon icon) method.
Another method is to rewrite the paintcomponent (Graphics g) or Paint (Graphics g) method. For example
public class ShowGifPanel exten
Java Swing 2D System attribute parameters detailed -dsun.java2d.opengl=trueIf hardware acceleration has been made, you can use this option to improve the swing GUI speed with the default value of False -dsun.java2d.trace=[log[,timestamp]],[count],[out:Help find out which swing component has a performance problem when drawing. -splash:filename.pngSplash screen app
xml| Create
I'm sure you have some knowledge of XML, and you might be tempted to write an XML text now, but there are so few cross-platform, free XML editors you can find now. So in this article, I would like to introduce or take you step-by-step to develop a simple XML editor, of course we want to use some of the most common Java 2 swing components, but these are free, some are JDK, some can be downloaded from the Internet. I think through this artic
are commonly used in desktop applications.2. Lack of rich component features: The button does not support pictures.3. No extensibility: The components of AWT are local components. The AWT class instance in the JVM is actually just a reference to the local component. The only extension point is the AWT's canvas component, which creates a custom component from scratch. However, it is not possible to inherit and reuse an existing AWT componentSwingSwing is a new graphical interface system built on
1. Swing overview The GUI (graphical user interface) provides a graphical interface for the program, originally designed to build a common GUI for programmersto run on all platforms . However, the basic class AWT(Abstract window Toolbox) in Java 1.0 did not meet this requirement, so Swing appeared, which is an enhanced component of the AWT component, but it does not completely replace the AWT components .
2.2.3 manage listener listIf we are creating our own components and want them to trigger events, we need to maintain a list of listeners to be notified. If the listener list is used for AWT events, we can use the AWTEventMulticaster class for list management. For the Swing library, if the event is not a predefined AWT event type, we need to manage the listener list by ourselves. By using the EventListenerList class in the javax.
In my opinion, Java is strong: Java is not only applicable to the B/s architecture of the program, is to do the service end of the choice, but also to do the C/S architecture program. While this technology is now being used less widely in the market and replaced by languages such as C #, Swing does have the ability to implement desktop client programs.The best way to learn Java is to know about swing, or wh
{Related Information}1. Program StructureSwing's programming is generally performed in the following process:(1) Introducing swing package via import.(2) Set the GUI's "appearance interface Style".(3) Create a top-level container.(4) Create components such as buttons and labels.(5) Add the component to the top-level container.(6) Add a boundary around the component.(7) Conduct event processing.2. Component classificationThe JComponent class is derived
1. Swing is an "enhanced" GUI component library based on AWT, which replaces most of the weight components of AWT with lightweight components and provides a few additional components and perception control components that AWT lacks to better reflect platform independence.
2. The weight component completes the work by entrusting the operating system counterpart components (i.e., user interface parts of the Windows operating system), including componen
Through this chapter of study, when our methods of work have changed dramatically in AWT (if you can recall a long time ago, when Java first came out, Sun announced that Java is a "stable, solid" programming language), it may have been a very immature Java feeling. Indeed, Java now has a good event model and an excellent component reuse design--javabeans. But the GUI component looks quite primitive, clumsy, and quite abstract.
Note: When writing this section, the
I used the Parent and Child Window to pass the value and searched the internet for a bunch of nonsense. I felt very uncomfortable. I studied it for a long time. It turned out to be very simple. The thread is also used in this example. You don't need to be more clear. Let's just move on to the code. note how to pass the value in the ///// Dialog Box package des; import java. AWT. color;
Import java. AWT. Dialog;
Import java. AWT. Font;
Import java. AWT. frame;
Import java. AWT. graphicsconfigurat
Article Source: Computer enthusiasts Author: Zhang Jian
Who knows how much sand the Babel waste? Who knows how many days and nights Rome has been built? The only thing we know is that without a block of bricks and mortar, there is no Great wall, and there is no eternal pyramid without boulders and clay heaps. This shows that the preparation of basic knowledge is essential for us to learn anything, so let's start by understanding some of the fundamental features of
Design
Regardless of whether your project uses swing technology, I would say that swing is a well-designed Java package that is full of the wisdom of the master. If you learn Java but can't even write a button, just like you learn Visual Basic but do not use the button, it is absolutely not to be forgiven. Swing technology has been widely used in foreign countrie
1. What is the Swt/swing designer? The Swt/swing designer is a Java GUI designer that makes it very easy to create Java GUI applications without having to spend a lot of time writing code that displays simple forms. You can use the WYSIWYG visual designer to create complex windows within minutes, while generating Java code. You can also use drag-and-drop operations to easily add controls, add event handlers
Implements the Q A System Based on java swing, and implements the Q A System Using javaswing.
The examples in this article share the specific code of the java swing Q A system for your reference. The specific content is as follows:
As shown in, the Code is available for test, as follows:
Import java. awt. borderLayout; import java. awt. color; import java. awt. gridLayout; import java. awt. event. actio
Detailed usage of swing split window control JSplitPane, swingjsplitpane
This article shares the usage of JSplitPane for your reference. The specific content is as follows:
1. The swing split window control JSplitPane is used to split the window into two parts.
2. Only one control can be placed in each split window. If you want to add multiple controls, you can create one JPane panel on the top so that mult
The SwingWorker in swing is primarily used to perform more time-consuming tasks.Some simple examples are included in the Java doc documentation.
An abstract class to perform lengthy gui-interaction tasks in a background thread. Several background threads can is used to execute such tasks. However, the exact strategy of choosing a thread for any particular swingworker are unspecified and should not being relied on .
When writing a multi-thread
Atitit. dd dragdrop drag function c#.net java Swing comparison and implementation summary1. Implementing a dd operation typically consists of three steps :12. NET blackheads drag mechanism . Must have DragEnter event (individual write DragDrop event is not drag-and-drop function) 23. Drag the ---java blackheads. There must be a DragEnter event (a separate write drop event will not have a drag function) 24. Code 35. Reference 51. Implement addoperati
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.