Panel assembly (Jpanel). An interface with only one jframe, but can have multiple JPanel components and JPanel components can be placed FlowLayout, borderlayout,gridlayout components, such a combination of use to achieve more complex layout effects such as: package gui;import java.awt.borderlayout;import Java.awt.gridlayout;import java.awt.FlowLayout;import Javax.swing.jbutton;import javax.swing.jframe;import javax.swing.jpanel;/** Panel assembly * Created by admin on 2017/7/2.*/ public class M
Swing's button component. In the Widgets class. To use a button, you must import Jbuttonimport Javax.swing.JButton; the button needs to be added to the Frame inside the package Gui;import Java.awt.frame;import Javax.swing.jframe;import javax.swing.jbutton;/*** Created by admin on 2017/6/30.* Java GUI learning */public class GUI extends J Frame{jbutton JButton = null;public static void Main (string[] args) {gui GUI = new Gui ();} Constructor public Gui
size, and create a new object hellocsdnpanel. This is because it is implemented in jframe, so we need to create a container C. put the Panel object we created into containerc.
Part 3
Class hellocsdnpanel extends jpanel {Public void paintcomponent (Graphics g ){Super. paintcomponent (g );G. drawstring ("Hello csdn. Net", message_x, message_y );}Public static final int message_x = 100;Public static final int message_y = 100;}/** A panel that displays a message*/Continue to inherit the n
(Graphics g) {super.paintcomponent (g); g.DrawString ("Hello csdn.net", message_x,message_y); public static final int message_x=100; public static final int message_y=100; }
We continue to inherit the newly established hellocsdnpanel to JPanel so that our objects have JPanel attributes, and then we can invoke the method of outputting the characters on the frame g.drawstring
From this program we can very well see the core of
A piece of
This article refers to the use of a small program "Swing Component Encyclopedia" to guide you to learn the Java language, familiar with the various components of Java Swing. In the course of learning, the author designs The method and thought of the program, and finally forms his own way of thinking and lea
structure of the frame:
------JFrame (bottom)
|
---------Jroot
|
---------JLayeredPane
|
-----------Menu Bar
|
-----------Content Pane
|
-----------Transparent pane (top level)
and in these 6 layers we are most related to the menu bar and the content pane. Because it feels like our frame.
Summary: You can see that swing is a good Java performance, no wonder that the
Minehe originalI read a post on the Java GUI, so I wrote an article to illustrate the advantages and disadvantages of various GUI technologies.In the Java World, the three most well-known GUI Libraries are:1. AWT (Abstract Window Toolkit) Abstract Window tool package library, which is included in all Java sdks2. Swing
InformationL2fprod-common swing has built many components, but some of the more popular components are not provided. this open-source project provides just these components that are missing. the l2fprod-common provides the following components: propertysheet, collapsible task pane, button bar, font chooser, directory chooser. the following is a component.
More l2fprod-common infoOyoaha look feel is now an open-source Project released based on Apach
The purpose of Java interface designDevelopers can develop rich and powerful desktop applications with graphical interfaces through Java SE. You can also design some tools to improve the efficiency of the software, to help you deal with mechanical work.Java's graphical interface toolkit can be used for tools such as software development, management software development, general client development, Bank clie
Both AWT and swing are packages in Java.
AWT (Abstract window Toolkit): Abstract Windows Toolkit, a package for early authoring of graphical interface applications.
Swing: A newly developed graph-bound bread to solve the problems of AWT. Swing is the improvement and extension of AWT.
AWT and
Who knows how much sand stone is consumed by the tower of Babylon in tongtian? Who knows how many days and nights Rome has been built? The only thing we know is that there is no great wall in the winding way without the building of bricks and stones. Without the accumulation of stones and clay, there will be no immutable pyramid. It can be seen that the preparation of basic knowledge is crucial for us to learn everything, so let's start from understanding some basic functions of
Understanding of Swing, AWT, and SWTSummary: Now that Java provides graphical GUI development tools beyond swing, what is the difference between them? This paper mainly analyzes the differences between SWING,AWT and SWT. 1, three of the overview:The AWT (Abstract Window Toolkit) is a set of graphical user interface Gu
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
Annotation: This article from the straight_talking_java@yahoogroups.com discussion group, has been more than a year ago. Alan William son is an editor of Java developers Journal. The following is a message source from him at IBM. I have seen a lot of SWT and swing debates, and there are also a lot of netbeans and eclipse. The translator's translation of this article is not a matter of dispute or support (
Source: computer enthusiasts Author: Zhang Jian
Who knows how much sand stone is consumed by the tower of Babylon in tongtian? Who knows how many days and nights Rome has been built? The only thing we know is that there is no great wall in the winding way without the building of bricks and stones. Without the accumulation of stones and clay, there will be no immutable pyramid. It can be seen that the preparation of basic knowledge is crucial for us to learn everything, so let's start from under
Swing APIs are designed to be powerful, flexible, and easy to use. In particular, we want programmers to easily create new swing components, whether from scratch or by extending some of the components we provide. For this purpose, swing components are not required to support multi-threaded access. Instead, we send a request to the component and execute the reque
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
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
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. Dia
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.