I have code that does certain stuff if it gets an intger argument, and other stuff if it is String.
How can I quickly check if one of my args from command line is actually an integer without doing a parseInt and catching an exception if it is not?#
Thanks
Hi,
I have 3 very similar FocusListeners and have been trying to find a way of having one and the labels and accesors & mutators accessed chaning depending on who triggered the listener.
There are 3 textFields (tN, tP and tK) and 3 mutators and accessors (getN(), getP() and getK())
The...
I have an application where entering certain numbers changes the data held, I had observers looking at these observables and when they are notified they make changes to what is displayed on screen, one of these is some swing graphics. I do a repaint() in the observer but when I run the app...
Sounds basic but when I write
tN = new TextField("1");
tN.setAlignment(CENTER);
I get "cannot find symbol" error, despite the JAVA Api says I should be able to.
Any ideas for center alignment of text field? Thanks.
I want to perform some actions upon the edit of a the content of a textField. Is a documentListner the easiest way? I've looked at these and they seem a bit complex.
I've created an app that has a GUI in a JFrame, I want to be able to stop the user dragging the sides of the frame to alter it's dimentions - how do I do this?
Thanks
I would like to know the easiest way of specifiying how wide I want a label to be? Do I have to make changes to my gridLayout or are there any mehods within the label itself to do this?
Thanks
How do you program to find mod 10 of a number in assembly? In total i need to output a number held in a registered to the screen so need to mod 10, add 30 and put on a stack to be popped off in reverse.
I have a GregorianCalendar variable ('due') and I would like to compare this with today's date and return true or false if it is beofre or after it.
Is there an easy way of doing this?
Cheers in advance.
I have the following code to get a file using a file chooser:
//**********
String filename = File.separator+"tmp";
JFileChooser fc = new JFileChooser(new File(filename));
fc.showOpenDialog(null);
File selectedFile = fc.getSelectedFile();
System.out.println(selectedFile);
Library lib =...
Is there a way of always ensuring people always see the latest version of a webpage rather than one stored in their temp documents? Ie. stops them needing to press refresh when they visit the page a 2nd time?
That's the problem. I think the CD drive has become uninstalled so I can't open or run any CDs. This happened once before and although the CD drive wouldn't function in windows I was able to get it to run the restore CD presumably from getting the CD to run on boot-up. However, this dosen't seem...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.