operation in the Windowclosing method of the registered WindowListener object.Hide_on_close (defined in windowconstants): The form is automatically hidden after any registered WindowListener object is called.Dispose_on_close (defined in windowconstants): Automatically hides and releases the form after calling any registered WindowListener object.Exit_on_close (defined in JFrame): Exits the application using the System exit method. Used only in the ap
A lot of times we get an interface, do not want the default border, or do not want the top right corner of the maximum button, such as the QQ panel does not have the maximum button.
But I checked a lot of information that can not directly remove the maximum button, you must have the entire border and the title are removed, and then draw their own.
The test code is also simple:
"1" jframe no border without
We know that the painting method is called every time you repaint in Java.Public void paint (Graphics g )...{
// Super. Paint (g );Color c = G. getcolor ();G. setcolor (new color (50,150, 50 ));G. filloval (tankpos. X, tankpos. Y, tankwid, tankhei );G. setcolor (C );} If the frame class in the AWT package is used to construct the window, the above method is correct. However, if the jframe class in swing is used as its subclass, it will be re-painte
Each time you write a graphical program, only manually adjust the JFrame frame size to display the contents. Using validate () does not work, and pack () can solve this problem.Pack ()//is automatically adapted to size. When writing a program, if preferred size is defined, the frame size is drawn according to the preferred size, or the component within the container is sized to fit.Vailate ()//is resized, provided the size has been set (SetSize () has
A lot of times we get an interface, do not want the default border, or do not want the top right corner of the maximum button, such as the QQ panel does not have the maximum button.
But I checked a lot of information that can not directly remove the maximum button, you must have the entire border and the title are removed, and then draw their own.
The test code is also simple:"1" jframe no border withou
By default, the frame is displayed in the upper-left corner of screen, and coordinates (0,0) change its position eg.Get the width and height of screen, Java.awt.ToolkitDimension Screensize=toolkit.getdefaulttoolkit (). Getscreensize ();int screenwidth=screensize.width;int screenheight=screensize.height;The upper-left corner coordinate of frame framesint x= (Screenwidth-frame.getwidth ())/2;ITN y= (Screenheight-frame.getheight ())/2;java-graphical inte
Java Implementation of Remote Desktop instance code, java instance code
Java Remote Desktop instance code
The control side transmits the mouse event to the server
The server receives the mouse event and transmits it to the client.
(); Intent.setaction (Intent.action_call); Intent.setdata (Uri.parse ("Tel:" + "123123")); StartActivity (Intent); }}, "Demo"); String Url=new string ("http://192.168.61.173:8080/myweb/zp.html"); Loading Web pages into Web controls weB.loadurl (URL); } }3, the page inside the button to use the hyperlink, the method is as follows:Where the demo is the class name, callous is the method of the demo class, the front window is the tag, plus not so-called
Java Web code generator, which focuses on Java Web project general purpose code generator and Java Web Code Generator
This project is a general code generator for the javaWEB project. j
Java User Rights Management framework source code Java Rights Management Java source Code framework code, User function permissions control to menu and menu action buttonmyeclipse+jdk1.6+apache-tomcat-6.0.14+sql2005/2008/2012is a
Common Code blocks in Java. Construct code blocks. Differences between static code blocks and code examples. java examples.
Execution sequence: (the priority ranges from high to low .) Static
In the past when wandering around the internet to find a lot of people to use Java to achieve the QQ after landing panel problems feel very headache, recently, I was writing a simulation QQ project, it is indispensable to meet this problem, I Google in the Internet, Baidu, and finally found that a lot of people are troubled by this problem, But there is no solution, it is estimated that those who wrote out of the people, did not publish to the Interne
Java code generates QR code images and java code
Jar package to be used: QRCode. jar
Click here to download QRCode. jar.
Because the code is relatively simple. I don't have to worry about it. I simply post the
compiled using java socket can run the accompanying source code. Please send it together with a tutorial. Email: hogsdi112 @ 163com
Import java.net .*;Import java. io .*;Import java. util .*;Public class ChatRoomServer {Public static void main (String [] args) throws Exception {ServerSocket ss = new ServerSocket (8000
Java 7: Reading Notes on core technologies and best practices-java source code and byte code operations, java 7 Best Practices
General process: developers write the java source code (.
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.