Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Z-order on Java Swing components

I've been looking all over for some mention of this, but I cannot find any substantial information on it. Is there a way to change the z-order of Swing components, or at least change the draw order so that they appear to be above others?

like image 354
Bevin Avatar asked Nov 19 '10 21:11

Bevin


People also ask

What are the five Java Swing components?

In Java Swing, there are a number of components like a scroll bar, button, text field, text area, checkbox, radio button, etc. All these components together, form a GUI that offers a rich set of functionalities and also allows high-level customization.

What are the 3 types of Java Swing containers?

As we mentioned before, Swing provides three generally useful top-level container classes: JFrame , JDialog , and JApplet .

What is Setlayout in Java Swing?

Java (Swing/AWT) uses something called LayoutManager s to place UI components on the screen. These LayoutManagers are responsible to render component such as TextField, CheckBox, etc in a predefined manner on your Window. For example: A LayoutManager called FlowLayout simply places components one after the other.


1 Answers

You are looking for setComponentZOrder

Here's an example.

like image 77
Amir Afghani Avatar answered Sep 21 '22 13:09

Amir Afghani