Today, I looked at the construction mode and came up with a bit of experience.
Apply a theory first: the construction mode separates the internal appearance of a product from the product generation process, so that a building process generates product objects with different internal appearances. The construction mode allows the product's internal appearance to change independently, so that the customer does not have to know the details of the product's internal composition. The construction mode
JAVA learning 58th-GUI
GUI
Graghical User Interface (graphical User Interface)
The objects provided by java for the GUI are included in the java. awt and java. swing packages.
Java's
Goals to achieve:Because there are a number of Java GUI components in the scroll box, the JPanel panel is used to wrap these components in a scroll-through-jscrollpane implementation.Question 1: The layout rubs togetherJPanel has its own default layout, so here we have to set the flow layout ourselvesJpanel_qanda.setlayout (null);Issue 2: Scroll bar does not take effectAt first I was setting the size of the
(string[] args) { persondirector pd = new Persondirector (); Person Womanperson = Pd.constructperson (New Manbuilder ()); Person Manperson = Pd.constructperson (New Womanbuilder ());} }The builder model can evolve in many forms during use: if there is only one concrete object to be built, the abstract builder and director can be omitted, allowing ConcreteBuilder to play the r
We all know that the Android anti-compilation tool inside the Jd-gui tool to view the jar source code, then how to save the Java source class. Actually set up, you can save the entire Java source of the jar with one click.First setFind the preferences click in Help and remove the two hooks in the red circle. In general, it is the default tick.If the hook, it will
Atitit. GUI interface skins and skin Resurfacing summary java. NET C + +1. Swing Skin 11.1. Windows style 11.2. MAC Style ( liquid frame) 12. How to add a watermark to an application or a background? 23. Popular swing Skin pack substance, Jtattoo 2C + + skin qt directly supports CSS , easy .. NET WinForm to take effect immediately ...When designing swing, Sun took into account the visual sense of the c
, giving people a sense of insensitivity.The swingworker or Timer class can solve this problem,Swingworker is a class defined by Java-tutorials, not a swing API.
SwingworkerAfter using other threads to execute time-consuming tasks, you can add GUI code to the Event-dispatching thread.The time-consuming task is written in construct (), and the GUI code after the t
Java GUI programming: coin gamePreface: I am very interested in learning java se GUI programming. I don't know why the teacher told me not to spend too much time on GUI programming. "I promise you won't be able to use java
by a non static object. We can find the corresponding evidence from the output results.It is necessary to summarize the process of creating the object here. Consider a class named dog:(1) When an object of type dog is first created, or the dog class's static method/static field is first accessed, the Java interpreter must find Dog.class (search in the predefined classpath).(2) After the Dog.class is found (it creates a class object that will be learn
The Java GUI (graphical user interface) consists of various components, mainly the AWT components (java.awt) and the more powerful swing components (javax.swing).Components can be divided into container components and non-container components. A container component is a component that can contain other components, and is divided into top-level containers and general-purpose containers. Non-container compone
First, the builder model(Builder)The factory class pattern provides the pattern of creating a single class, while the builder pattern is to centralize the various products to manage, to create composite objects, so-called composite objects that refer to a class that has different properties, in fact the builder pattern
Java is a very powerful programming language, but Java's GUI power has always been its Achilles heel. Although Java offers 2 graphics solutions, AWT and swing. However, these 2 graphics libraries are very limited in functionality, and they do not bring more user experience. And AWT and swing are slow to update. All the while to the
task. Second, the flexibility of such a constructor is not high, and you have to provide some meaningless parameter values at the time of invocation, for example, Dodocontact ("Ace",-1, "SH"), obviously the age of negative is meaningless, but you do not do so, to conform to Java specifications. If such code is released, the maintainer behind it will have a headache because he doesn't know what the 1 means. For such cases, it is very well suited to us
have to provide meaningless parameter values during calling, such as dodocontact ("Ace",-1, "sh"). Obviously, it doesn't make sense to have a negative age, but you don't need to do this, so it can comply with Java specifications. IfCodeAfter the release, the maintainer will have a headache because he does not know what this-1 means. In this case, the builder mode is very suitable. The main point of the
Java GUI (graphical user interface) exercises
6.1.3 a simple GUI Program
Package six; import javax. swing. *; import java. awt. *; import java. awt. event. *; public class Main {private static int numclicks = 0; // number of records private static JFrame frame = new JFrame
Consoleprintstream Extends Printstream { 9 Private Text text; 10 11 Public Consoleprintstream (outputstream out, text ){ 12 Super (Out ); 13 This . Text = Text; 14 } 15 16 /** 17 * Indicates the method used to re-intercept the write method. All printing methods must be called. 18 */ 19 Public Void Write ( Byte [] Buf, Int Off, Int Len ){ 20 Final String message = New String (BUF, off, Len ); 21 If (Text ! = Null ! Text. isdis
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.