There are many parameters in Java that can make the components transparent to users! I think this is better.
First, the component transparency:
In Java components, except for some restrictions on jlabel and label, they are set as Java components that do not draw borders.
I have been doing something about Java swing recently. Although it is said that the current rolling wing is not very popular, it is only necessary to change some of the classic components of the rolling wing.
There are many parameters in Java that can make the components transparent to users! I think this is better.
First, the component transparency:
In Java components, except for some restrictions on jlabel and label, they are set as Java components that do not draw borders.
Swingbutton =NewJbutton ("swingbutton ");
Swingbutton. setopaque (True);
FinalJlabel label =NewJlabel ("label ");
Label. setopaque (isopaque ());
Public voidSetopaque(Boolean isopaque)
If true, the component draws all pixels within its boundary. Otherwise, the component may not draw part or all pixels, so that the underlying pixels can be viewed.
For jcomponent, the default value of this attribute is false. However, for most standard jcomponent subclasses (such as jbutton and jtree), the default value of this attribute is related to the appearance.
Public BooleanIsopaque()
If this component is completely opaque, true is returned.
The opacity component draws each pixel within its Rectangular boundary. A transparent component only draws part of the pixels or does not draw any pixels, allowing its underlying pixels to be "pivoting out ". Therefore, components that do not completely draw their pixels provide a certain degree of transparency.
Make sure that the subclass that always draws its content should override this method and return true.
There is also a robot class in Java. I believe you have seen a lot about Java on the Internet.
Write a magnifier program, which also reflects the Java transparent feature. In addition, some attributes that have been seen in the new version of Java (JDK) can be directly set to transparent or transparent to some Java components.
This is a code snippet written by a netizen on the Internet: it shows the desktop magnifier function:Private int relativecoordinateywhenmousepressed; </P> <p>/** </P> <p> * indicates whether the mouse is pressed. If you press it, it is true; otherwise, it is false </P> <p> */</P> <p> private Boolean mousepressednow; </P> <p>/** </P> <p> * magnifier size </P> <p> */</P> <p> private int magnifiersize = 100; </P> <p>/** </P> <p> * magnifier content panel </P> <p> */</P> <p> private magnifierpanel = new magnifierpanel (magnifiersize ); </P> <p>/** </P> <p> * constructor, create a magnifier form </P> <p> */</P> <p> Public magnifier () </P> <p >{</P> <p> setundecorated (true); // form edge </P> <p> setresizable (false ); </P> <p> container. add (magnifierpanel); </P> <p> addmouselistener (New mousefunctions (); </P> <p> addmousemotionlistener (New mousemotionfunctions ()); </P> <p> updatesize (magnifiersize); </P> <p> This. setvisible (true); </P> <p >}</P> <p>
So in the Java World, everything will be "Transparent"