Can't get JLayeredPane to work
Hi,
I'm trying to use the JLayeredPane as part of a large application, but I can't get a small example to work... What else do I need to set before I can see my JLabel?
package views;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
public class Test extends JFrame {
* @param args
public static void main(String[] args) {
new Test();
public Test()
super("Test");
this.setVisible(true);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setSize(new Dimension(200, 200));
JLayeredPane pane = (JLayeredPane) this.add(new JLayeredPane());
pane.add(new JLabel("Hello World"), new Integer(0));
this.add(pane);
}Edited by: TheDauntless on Oct 24, 2009 12:55 PM
TheDauntless wrote:
Thanks, that seems to work. You're welcome.
I have a follow up question: How can I get my JLabel to take up the entire parents width & height?
I usually use a GridBagLayout (with fill=horizontal, weightx=1, heightx=1, gridx=0, gridy=0), but I can't always get it to work. Is there a better way to make sure the size is 100%x100% ?I know that I use GridBagLayout, but only sparingly and only when other layouts (including nested layouts) won't work. I think that there are several in this same camp. In your situation, you could easily just use a BorderLayout and add the JLabel BorderLayout.CENTER.
Similar Messages
-
Have entrourage and want to use Mail. Can't get it to work.
I had a macbook and purchased the Microsoft office for Mac which included Entrourage.
I have now purchased a new macbook Pro and want to begin to use Mail rather than Entrourage.
I have Entrourage on my new computer but i can't get it to transfer my information to the the Mail program
I am on Charter.net at my office and sbcglobal.net at home.
How can i get this to work. I can receive on Mail, but i can't send.check your outgoing port settings and make sure it's using a specific port and not the default port, also you might want to check to see if it is using SSL, TLS or any other encryption. Verify the setting from your old machine setup.
-
got my password wrong twice and my mini is disable. I connected to iTunes, but can't get it to work. Can some one guide my through?
If it's showing the red disabled screen due to incorrect passcodes then you may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808 - you should then be able to reset the iPad via your computer's iTunes and restore/resync your content to it
-
HT1151 i have a new apple external dvd drive, and i can't get it to work with my iMac?
I have a new apple dvd drive, I was told it will work with my imac, but when i plug it in ...nothing... iv been for update... still nothing. How can i get it to work???
If it is this drive, note that it is for MBA's and Mini's only:
http://store.apple.com/us/product/MC684ZM/A
Ciao. -
Is there a way to reset my messages account, I can't get iMessage to work on IPad nor Mac osx. Help please this is really frustrating.
Hi,
Is there an iPhone involved ?
If not, what happens if you remove the Apple ID on the iPad and then set it in Airplane Mode (allow a couple of minutes at this point) followed by re-adding the Apple ID ?
What, if any error messages are appearing on the Mac when you try to launch the App or Login to the iMessages server ?
Is the Apple ID linked to an iCloud account ?
In Messages 7 (Mountain Lion) this did not seem to be important but it seems it is in Mavericks/Messages 8
9:14 pm Friday; April 11, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
I bought an IR receiver and an Apple Remote, and I can't get it to work. What am I doing wrong? The receiver is a Lenovo eHome OVU430006/01 USB IR Receiver.
Hello,
You would need to pair the Apple Remote with the receiver. So I would use the generic Mac/PC receiver and follow these instructions:
http://support.apple.com/kb/HT1619
If that doesn't work then check in System Profiler to see if the IR receiver has been recognized by the PowerBook's hardware. You may require the install of drivers for this device to be recognized.
Best of luck -
I have a go daddy email account and I can't get it to work on my iPad
I have a go daddy email account and I can't get it to work on my iPad
Try turning the email account off and then turn it on again. Settings>Mail, Contacts, Calendars>select your gmail account>Off. Go to the mail app and then come back to the account in the settings and turn it on again.
If you can't find any other way for the iPad to accept the password, delete the email account and then add it back onto the iPad. -
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
I have a Mac Mini and I can't get it to work with my Ricoh Aficio MP 161. Any ideas?
The latest Apple driver support begins with the MP 171.
Here is Ricoh's official driver download page specifically for the Afico MP 161. Note that new drivers for this device were released on Aug 2, and include Lion and Mountain Lion.
Hopefully, this will solve your device issues. -
Iphone 5 went black. Tried pushing on/off and circle at the same time. Worked yesterday and then did it again today. Can't get it to work.
You need to hold those button longer until you see the apple logo, then release, then wait for the phone to boot back up.
-
I just bought a new computer and had files transferred along with itunes to the new computer. I can't get it to work. It doesn't recognize the extensions for itunes. I also tried downloading Quicktime and couldn't get it to download.
iOS: Device not recognized in iTunes for Windows
I would start with:
Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7 -
I bought a DATAPILOT to transfer pictures to my macbook and can't get it to work. Any suggestions please?
Best if you try and explain what you are trying to acheive.
Iphoto is a different paradigm than you're used to. I don't understand why you are trying to transfer your edited photos back to an external disk.
There are tutorials here
http://www.apple.com/findouthow/photos/
Regards
TD -
I have signed up for adobe conversion to microsoft word and i can't get it to work - can you help me
I have signed up for adobe conversion to microsoft word and I can not get it to work - can you help me?
Hi Mike,
I've checked your account. I see that you just purchased the subscription this morning. The order is still pending processing, which is why you haven't yet been able to log in an use your subscription. It can take 24-48 hours for a subscription to process fully. Once it does, you'll be able to log in and convert files.
I apologize for the inconvenience.
Best,
Sara -
Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?
Trying to connect 2010 Mac mini to alba hd tv but can't get it to work, any theories?
Welcome to the Apple Community.
The iPad 1 is only able to do basic AirPlay, many providers of programming have blocked their apps from working with AirPlay. -
I just bought Quick time Pro and I can't get it to install. It shows a yellow box in my application folder, but I can't get it to work. Help!
you launch QT then go to its REGISTRATION
-
Downloaded the App Sales Call Manager. I can't get it to work on either my Iphone 4s or my Ipad2? Can anybody advise how to fix or even get back my money that i paid for it?
Contact the app developer for support. A link to their website will be in the apps description in the AppStore.
Maybe you are looking for
-
I have a problem sending mail from an external client to a file folder in Vibe. The things I have tried are giving access to the folder for all users, guest and the groupwise program within the Vibe access control option. Now the error is: The error
-
Variable characteristic input in URL
Hi Gurus I need to make the characteristic "costumer" into a part of the URL string to ta given Query. Is this possible and if so how do I do it?
-
ISO code 0 is not correct in the VAT registration number
Hello everyone! Where can I adjust this error message so that I can make it as a Warning only? Thank you. Message No. AR191 -- ISO code 0 is not correct in the VAT registration number
-
FM/BAPI for assigning a class and value instead of manualy doing in IE02
hi guys, i need a FM/BAPI which will allow me to take input as equipment number and assign the class and value for it as done manually in IE02. Input should be equipment number. POINTS will be given.
-
Notification words "Text Messages" in BB Hub is in French - "Missatges de text"
Just got my Z10 a week ago and I love it. still figuring out some of the workings, but in general I'm enjoying it. Only weird thing is that in my BB Hub, the words "Text Message" actually appear in French - "Missatges de text" and I can't figure ou