My default window manager has always been using Beryl and there is no problem. Whether it is development (Java) or general applications.
When developing Java Desktop applications, I usually use SWT, AWT, and swing for a long time. Today I used them and suddenly found a problem:
When Beryl is enabled for AWT/swing, the control cannot be displayed, that is, it cannot be drawn, and it is depressing.
To Java
Li Wu:Learn to think more, honouring teachers save Thanksgiving. Leaf See Root 321, rivers with one.Meekness Conscience Lord, willing to do without regrets to the most bitter. Reading exercise strong body and mind, Prudential advised and the line and cherish.
Os:windows7 x64
Jdk:jdk-8u131-windows-x64
Ide:eclipse Oxygen Release (4.7.0)
CodePackage Jizuiku.image;import Java.awt.color;import Java.awt.font;import java.awt.graphics2d;import Java.awt.image.bufferedimage;import Java.i
Perhaps you used to use AWT to design a graphical user interface (GUI), how do you feel? Now that JAVA2 offers a swing pack that shows you a richer set of features, the interface you use to design it will be friendlier, so let's take a look.
Before you designed a small application to expand the applet (Java.applet.Applet); Now to use swing packs, you want to extend JApplet (Javax.swing.JApplet) Let's look at an example of an extended JApplet applet a
gui--graphical user Interface GUI. Introduction: AWT is the first GUI class library package in the Java language. Java is a platform-independent programming language, but the GUI is often dependent on a specific platform, Java uses the appropriate technology to enable AWT to provide applications independent of the Machine platform interface, which ensures that the same program's GUI on different machines
JDK Doc document class to see the method inside addActionListener ()addActionListener public void addActionListener(ActionListener l)Adds the specified action listener to receive action events from this button.[Add a specific action when the supervisor hears the event received from this button].
Delegate Model Benefits
1) events are not handled unexpectedly.2) It is possible to create and classify event actions using the adapter (adapter) class.3) The delegate model facilitates
1. GraphicsTo achieve a variety of graphics, text and picture drawing operations.2. Drawing Color and Stroke properties(1) Color propertiesColor col= new Color (int r,int g,int b)Color col = new Color (int RGB)Method: SetColor (color color)(2) Stroke propertiesSetstroke (Stroke stroke)3. Draw Text(1) Setting the fontFont (String name,int style,int size)SetFont (font font)(2) Display textDrawString ()(3) Drawing picturesDrawImage ()(4) Picture rotationRotate ()(5) Image tiltShear ()18.
Solution ):
When using COM. Sun. AWT. awtutilities, eclipse gives a error:
-Access restriction: The method setwindowopacity (window, float) from the type awtutilities is not accessible due to restriction on requiredLibrary c: \ Program Files \ Java \ jre6 \ Lib \ RT. Jar-Access restriction: The type awtutilities is not accessible due to restriction on required library C: \ Program Files \ Java \ jre6 \ Lib \ RT. Jar
You can fix it lik
handler function on the Red Fork @overridepublic void windowclosing (WindowEvent e) {//TODO auto-generated method s TubSystem.out.println ("End of program Run"); System.exit (0);}); /Visible f.setvisible (True);}}ResultClick on the Red Fork, the form closesJava is good, worth learning.Learning resources: Itcast and Itheima Video library. If you have public resources, can share to me, with your resources to learn also can.Blog post is to watch the video, into thinking written. It's good that the
("Prepare to close window ...");System.out.println ("closed");System.exit (0);}});Txf.addkeylistener (New Keyadapter () {/*** @parame keypressed Set keyboard listener events, set only 0 to 9 digits* You can delete a number using the DELETE key*/public void keypressed (KeyEvent e) {Set the obtained key number, which is stored in ASCIIint keycode = E.getkeycode ();if (! ( KeyCode >= keyevent.vk_0 keycode if (keycode! = keyevent.vk_back_space) {System.out.println (keycode + = = = Key ILLEGAL!!!!!
(1) Events (event): Describes the object in which an event occurs;
(2) event Source: event generator; (3) Event Handlers: Method for accepting event objects, interpreting event objects, and processing user interactions; (4) event model of jdk1.1; delegate model; event listener: class that implements the listener interface. A listener object is an instance of the class that implements the special listener interface;
The event sources and event handlers are separated;When the button event is tri
Li Wu:Learn to think more, honouring teachers save Thanksgiving. Leaf See root Three return one, living water Qingyuan hidden in zero.Meekness The Lord of Conscience, Haoyuedangkong the King of Freedom. Willing to give the most ascetic no regrets, sincere advice and the line and cherish.
Os:windows7 x64
Jdk:jdk-8u131-windows-x64
Ide:eclipse Oxygen Release (4.7.0)
CodePackage Blog.jizuiku3;import Java.awt.color;import java.awt.frame;/** * A simple example of setting the backgrou
Li Wu:Learn to think more, honouring teachers save Thanksgiving. Leaf See root Three return one, living water Qingyuan hidden in zero.Meekness The Lord of Conscience, Haoyuedangkong the King of Freedom. Willing to give the most ascetic no regrets, sincere advice and the line and cherish.
Os:windows7 x64
Jdk:jdk-8u131-windows-x64
Ide:eclipse Oxygen Release (4.7.0)
CodePackage Blog.jizuiku2;import Java.awt.button;import Java.awt.flowlayout;import java.awt.frame;import Java.awt.ev
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.