Results 1 to 8 of 8
- 03-07-2009, 11:01 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
-
You don't really need to overlap anything here. I'd just draw the image in a JPanel by overriding its paintComponent method, and then place the JProgressBar in this JPanel using your usual layout managers. As for sample code, plenty to be found on this forum, the forums.sun.com forum, and other sites. One of my favorites is this one: JavaRanch - Background Image On J Panel
- 03-07-2009, 05:49 PM #3
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
I am asking if you have a example on implmenting ttwo components that overlap. The problem is that my progressbar and my JFrame keep avoiding each other. I cant get them to overlap
-
A JProgressBar is derived from JComponent just like a JButton or JPanel or JComboBox. Again, you place this on a JPanel just as you would place a JButton, or other JPanel or JComboBox on a JPanel. There really is no difference here, and so I cannot understand what difficulties you are currently having. What layout manager is the JPanel that is supposed to hold the JProgressBar using?
- 03-07-2009, 08:28 PM #5
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
- 03-08-2009, 05:44 AM #6
Member
- Join Date
- Oct 2008
- Posts
- 58
- Rep Power
- 0
My JPEG is my background image. I want the JProgressBar to overlap it. It cant just be alone at the bottom.
-
Again, I suggest you try what I've suggested above.
To reiterate:
1) Create a JPanel and override its paintComponent method. Draw your image in this method as per my link above.
2) Add your JProgressBar to this JPanel, positioning it with whatever layout manager works best for you. If you're not clear on this, then read the layout manager section of the Sun Swing tutorial.
3) Add this JPanel to a JFrame or JApplet and view to your heart's content.
This will work. If you don't understand it, then please ask what specifically about it doesn't make sense.Last edited by Fubarable; 03-08-2009 at 06:53 AM.
- 03-08-2009, 10:16 AM #8
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
Similar Threads
-
Image Coversion .indd to .jpeg
By vipin.arora@hcl.in in forum AWT / SwingReplies: 4Last Post: 02-12-2009, 07:52 AM -
Placing Files In Folder
By ramesh.8189 in forum New To JavaReplies: 0Last Post: 02-06-2009, 12:36 PM -
[SOLVED] Netbeans Desktop App & JProgressBar
By SebScoFr in forum NetBeansReplies: 3Last Post: 11-27-2008, 11:00 PM -
To open an image file such as Jpeg file using JAva Program
By itmani2020 in forum Advanced JavaReplies: 10Last Post: 07-11-2008, 09:57 AM -
Simplest way to read and display a jpeg image
By Hasan in forum New To JavaReplies: 1Last Post: 05-31-2007, 03:42 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks