Veil LoadingImage or LoadingPanel over JFrame - java

Is there any component in Swing(X) by which we can place a veil loading image over a panel or frame making it transparent during some lengthy background processing?

Few examples of Romain Guy's work:
Chapter 9 of “Filthy Rich Clients” book, with downloadable code
SwingFX: Pretty Progress Panels
Glasspane Painting
GlassPane Intercepts
And other example:
GlassExample

You're looking for the Glass Pane, work through the tutorial here and the relevant section here

You need to add a glasspane to the frame, thats right. But you also can use SwingX' JXFrame and simply set a waitpane and activate it when a loading action starts.
Have a look at the API

Related

How to use Postprocessing on an awt or swing window

Is it possible to use Post Processing effects like gaussian blur or greyscale effects on an entire JFrame independent from its contents?
I would guess you are looking at the JLayer class. See How to Decorate Components with the JLayer Class for more information and examples.
Another option might be to use a Glass Pane. See the glass pane demo from How to Use Root Panes.

Swing method to show or hide part of a panel on button click?

I'd like to be able to show and hide (and therefore grow and shrink the jpanel as appropriate) in my swing application. I've seen something similar on websites that I imagine uses JS and JQuery.
What I'm after is the ability to click a button (that might say 'Advanced options') that then 'slowly' grows the panel and reveals (setVisible(true)) components.
Is this possible using Swing? I've tried looking round the web, and SO but I only seem to get JQuery questions, or unhelpful Java posts. This is the closest I've found.
Use a Swing Timer to animate your slide. For example, this link has code that places the components in a JLayeredPane and slides one component over the other, again using a Swing Timer: slide effect with JPanel.
Another useful effect is to fade out from one JPanel to another. For an example of this that uses a Swing Timer as well as a CardLayout, please check out this answer.

Resizing a JPanel inside a JFrame

I am new to Java, started learning swing and have a problem with resizing a JPanel inside a JFrame. I am following this tutorial:
http://vincentramdhanie.blogspot.com/2009/11/cardlayout-with-netbeans.html
because ultimately I am learning each of the different layouts and have come to the CardLayout now. In the above, there is a JPanel being used for a status panel. That is what I want to do as well, but when I drag a JPanel onto my blank JForm it takes up all the space and I don't see any resizing handles for it like I would if I were using a .NET panel. Changing preferredSize in the properties window also does nothing. What am I missing here? I feel like a complete noob for asking such a basic question but I really can't find any way to resize this thing.. :-|
EDIT:
I forgot to mention; I am using NetBeans IDE
You can't resize the JComponent because you've select CardLayout. The CardLayout can holds/manages one or more components that share the same display space.
What you need to read documentation and good tutorials.

JAVA: awt on swing component displaying problem

I am using java to design a GUI; I inserted a java.awt.List on a JPanel component. My program works correctly but as showing this panel I see delay and displacement problem in showing List component. I can use javax.swing.JList (Swing component) on Jpanel and result is OK. Is there a constant problem in using awt components on swing components? Can I solve it to use java.awt.List on my JPanel?
thank you all....
sajad
nobody know how your code works, you have to show us for better/valuable answer for your problem(s), but there still not good idea Mixing heavy and light components or here maybe this post can help you
EDIT: bacis tutorial about JPanel with JList layed by some of LayoutManagers, examples for that on Java2s.com inc. Layout

Lightweight on top of heavyweight

I have a JFrame that has a JLayeredPane. The JLayeredPane contains a heavyweight component (Ardor3d AWT canvas). I am trying to display a JPanel on top of the heavyweight component. This works perfectly until I set the size of the frame to the size of my monitor. The heavyweight seems to draw over the Jpanel that I want on top.
Any ideas?
This might help you: http://java.sun.com/developer/technicalArticles/GUI/mixing_components/
Yes, this is why you should not mix heavyweight and lightweight components. Extend JComponent and override paintComponent() instead of using a canvas.
You mention Ardor3d, I assume that is some sort of 3rd party component. If there is not a Swing version I would suggest finding something else to meet your need.

Categories