Is there any way around this?
Is it possible to pass an argument from main to an inner class without wrapping it up in a final String array of length 1?
public static void main(String[] args) {
final String[] filename = new String[1];
if(args.length != 1){
System.exit(0);
filename[0] = args[0];
SwingUtilities.invokeLater(new Runnable(){
public void run(){
JFrame jf = new SomeFrame(filename[0]);
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
jf.pack();
jf.setVisible(true);
}
Hmm, final arguments. That actually makes sense. Wonder why you don't see that more often on examples or when your IDE creates the main for you.
And in response to someone's suggestion about just declaring it final when you need it....
final String filename = args[0];I am actually setting it in different places depending on the number of arguments.
The first example I put was pretty stripped down...
public static void main(String[] args) {
final String[] filename = new String[1];
final int[] portnumber = new int[1];
portnumber[0] = 0;
try{
if(args.length == 1){
if(args[0].contains(".svg")){
filename[0] = args[0];
} else {
throw new IllegalArgumentException();
} else if(args.length == 3){
if(args[0].equals("--listenPort") && args[2].contains(".svg")){
filename[0] = args[2];
portnumber[0] = Integer.parseInt(args[1]);
if(portnumber[0] < 0)
throw new IllegalArgumentException();
} else {
throw new IllegalArgumentException();
} else {
throw new IllegalArgumentException();
} catch (IllegalArgumentException ex){
showUsage();
System.exit(0);
SwingUtilities.invokeLater(new Runnable(){
public void run(){
JFrame jf = new SVGViewer(filename[0], portnumber[0]);
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
jf.pack();
jf.setVisible(true);
}
Similar Messages
-
I rented a movie through itunes on my ipad and wanted to watch it with friends on a digital projector, but it wouldn't allow me to do it. Is there any way around this?
The issue was that a dialogue box came up which said that I couldn't play this movie on another device. I tried playing the same movie on an Tv with an HDMI connection attached to an adapter to the IPad and that worked. I wonder if the problem is that the digital projector has a VGA connection.
-
So my phone is messed up and you can't do anything with the screen...in order for me to sink it to back up i have to enter the passcode because it had a lock on it...and i can't due to it being messed up...is there any way around this...
See Here > http://support.apple.com/kb/HT1808
You may need to try this More than Once... Be sure to Follow ALL the Steps...
Take your time... Pay particular attention to Steps 3 and 4.
Make sure you have the Current Version of iTunes Installed on your computer
iTunes free download from www.itunes.com/download
After you have Recovered your Device...
Re-Sync your Content or Restore from the most recent Backup...
Restore from Backup > http://support.apple.com/kb/ht1766 -
When I try to buy ibooks from my ipad, the virtual keyboard is not the same as my computer keyboard, and since my password consists of letters, numbers and symbols, the ipad keeps displaying "incorrect password". Is there any way around this please anybody?
katykittenoid wrote:
the virtual keyboard is not the same as my computer keyboard
Are you using the virtual keyboard to input your password and you cannot see/find the characters you need on that keyboard?
Or are you trying to use a bluetooth keyboard and pressing the printed key does not produce the right character? -
Why are HP printer cartridges country specific? Is there any way around this?
I have just moved from the UK to Newfoundland, Canada and I have brought my HP PSC 1610 printer with me. I was advised not to bring any cartridges with me because they would explode during the flight so I had to buy new cartridges upon arrival.
I noticed that the cartridge numbers recommended for my printer were similar but not exactly the same but the (HP, etc.) websites I looked at did not mention that HP printer cartridges country specific.
In the UK black cartridge is an HP338 (C8765EE).
In Canada the websites told me that the black cartridge is a 94 (C8765WC).
I ordered a 94 cartridge (which took an indordinate amount of time to be delivered) and when I installed it my printer would not accept it ("not intended for use in this printer" error message) even though it fit perfectly. I looked at the packaging in greater detail and noticed that I had been sent a 94 (C8765WL) and I also noticed (in a very small font size) "for sale only in Latin America".
My questions are therefore:
1) Why are HP printer cartridges country specific?
2) Is there any way around this? Eg is there anything I can do to my printer/ laptop to tell it to accept this cartridge?
3) Are 94/ C8765WL cartidges compatible with 94/ C8765WC cartirdges? Ie did the supplier sell me something that couldn't be used even if I had a Canadian HP PSC 1610 printer?
4) Can I return the cartridges to the supplier given that it is based in Canada, they delivered it to me in Canada and yet they sold me a product that says "for sale only in Latin America"?
Thanks
anenglishmaninsaintjohnsYou will need to Contact HP to request a "Regionalization Reset". There should not be any charge for this, it is covered as part of the cartridge warranty. You will need to have access to your computer and printer while on the line with HP. You will also need to have a set of cartridges for the new region, once the reset is complete cartridges from the original region will no longer work. HP's web page on the subject is here.
Bob Headrick, HP Expert
I am not an employee of HP, I am a volunteer posting here on my own time.
If your problem is solved please click the "Accept as Solution" button ------------V
If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V -
my on/off button does not appear to be working on my iphone 3.....is there any way around this....anyway around this?...the phone also periodically just switches off.
Likely a hardware issue... no way around that except to get it repaired or don't use it (the button).
Try restoring to solve the switching off problem. -
I have highlighted words in an .iba file. Now I need to increase the space before (and/or after) the paragraph it's contained in. If I increase the space after, the height of the highlighting increases also. Is there any way around this?
http://www.apple.com/feedback/kaywerty wrote:
A rather long winded way of asking if anybody knows if it's possible to have multi-windows open
It's not possible.
Suggestions here -> Apple Product feedback -
I am a student trying to purchase creative cloud with a maestro card but won't allow anything other than master card or visa, is there any way around this?
No, not that I know about... but you might check the credit card page to see if there is an option
Change/Verify Account https://forums.adobe.com/thread/1465499 may help
-Credit card https://helpx.adobe.com/utilities/credit-card.html -
I cannot preview the iBooks I am creating on my MacBook because my iPad is "supervised" by my employer's computer. Is there any way around this?
Email your .ibook file to your supervisor; put your .ibook file on a server and use whatever iPad to navigate there via Safari, then download and open using iBooks.
See iBooks Author: Publishing and distribution FAQ - Support -
I am having problems playing half my games on facebook because of abod flash player is there any way around this?
Not for interactive content such as games.
(60255) -
I have a Netgear NAS which uses Stora software. Mavericks will not let me install the software as it is not from an approved developer. Is there any way around this?
There is, but why do you need the s/w installed? The NAS should have a web admin interface, accessible via ip address (http://<ip address>) which should allow all the needed configuration that is required for it to work with machines running os x.
Try to install as little s/w as you need to do something in Mavericks or any OS as it is usually the cause of future issues or problems.
If you're intent on installing the s/w, go to System Preferences > Security & Privacy > General and If you have tried to run it before, it should be listed there. You can then "un-block" it should you wish. -
I have a Belgian Apple ID, but want to use the UK i-tunes store. I get a dialogue box saying "This Apple ID is only valid for purchases in the Belgian itune store". Is there any way around this? Thanks, Jackie and Manuel
When you move to Portugal (very nice, I've just come back from visiting Cascais/Sintra/Sines ) I think you'll just get re-directed to Portuguese iTunes. When I moved to France from the UK I got re-directed to the French store.
To view UK programmes in France I used to subscribe to a VPN server through https://www.my-private-network.co.uk/ (there are others, but very pleased with their service). The catch-up channels (iPlayer, etc) think you're in the UK so you can watch the programmes online. Wouldn't work with iTunes UK store though . -
iPhone 5c voice dial cannot be disabled after software update. Is there any way around this?
Hi! It seems you found a bug on iOS 7.1
To disable Voice dials try this, (I saw in an iPhone website here in Brazil):
1. Turn on Siri (settings > General > Siri)
2. go to (Settings >Passcode > Voice Dial) trust me, it appears now
3. disable Voice Dial
4. go back and disable Siri
hope this could help you!! -
I recently upgraded from OS 10.5 on a PowerMac G5 to an early Intel Mac Pro running 10.7.5. To my consternation, I now find that my scroll wheel operates backwards from what I'm used to. Did Apple make a change that caused that? Is there any way around this?
Apple didn't make this easy, did they! When Lion first came out, I think that check box was under the Trackpad heading of the System Preferences, whether you actually had a trackpad or not. I take it there's nothing there, either?
I plugged a plain ol' three button Logitech mouse into the iMac, and while the Mouse panel options did change some, the same check box for Move content in the direction of finger movement when scrolling or navigating was there. -
My home movie DVD folders all have red circle with white dash and won't allow the files to be read. Is there any way around this so I can back up the DVD's on a external HD?
Drag the folders to the external drive, and if prompted, click Authenticate. You'll probably be asked for an administrator password.
(116608) -
i got my iphone 4 off my boyfriend as mine had broke and he upgraded to a 5c.
And the other day i restored my iphone by mistake and now it's not letting me on it unless i give the password to the account which neither of us have, or cannnot get hold of. Is there another way around this? or not?No there is no way around this.
iCloud: Activation Lock
Maybe you are looking for
-
What info do i need to send in my ipod touch to be replaced (i still have the 1 year warranty) and how do i get the box to ship it in also I have no clue what the address is please help
-
Loss of parts when "reducing model" in Acrobat 3D-Toolkit
My problem: If I want to reduce my file-size, it is possible to reduce the model via the same-named button. If I want to finish the prodecure and click on the OK-button, the part of my model which I wanted to reduce is deleted. So what can I do?
-
Dose Java has Static class? What is diff between static class and a final class which all method are static in java?
-
Change Schedule Lines values for Each Item for a Scheduling Agreement ?
Hii I want to change the Schedule Line Schedule Qty for Each Line item for a Scheduling Agreement . I cannot use BAPI_PO_CHANGE as this is for PO only and gives error for a scheduling agreement. I am on 4.6c so i SAP does not have BAPI_AGREEMENT_
-
Hi I'm using iPhoto 9.1.1. I have a problem with the flickr upload. The photos and videos upload (albeit very slowly compared to standalone flickr app) but the set that is created in iPhoto based on the event is never created. I'm left with a list of