Skip to content

Tag: java

Java static serialization rules?

I’m working on a save state serialization with a few static methods and fields. I could have sworn though that serialization and static’s caused mayhem. Should I make all static’s transient? And will inflating the calls restore the statics as normal? Answer statics are implicitly transient, …

Why jframe hides taskbar when maximized?

I’m using setUndecorated(true); and getRootPane().setWindowDecorationStyle(JRootPane.FRAME); in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar? Also when I maximize minimize my fram…

About unsynchronized & synchronized access in Java Collections Framework?

Can anyone explain what is unsynchronized & synchronized access in Java Collections Framework? Answer Synchronized vs unsynchronized access doesn’t have to do with the Java Collections Framework per see. Synchronized access means that you have some sort of locking for accessing the data. This can be…

How to run a java class with a jar in the classpath?

So, I can do this very well: if ./mypackage/MyClass.class exists. I can also happily do this: if the class file exists in the appropriate part of the jar. Easy stuff. But I can’t for the life of me manage to do something like this: where ./mypackage/MyClass.class exists, and where ./utilities.jar exists…

java SimpleDateFormat

in Java, how to parse a date string that contains a letter that does not represent a pattern? “2007-11-02T14:46:03+01:00″ String date =”2007-11-02T14:46:03+01:00”; String format = “yyyy-MM-ddTHH:mm:ssz”; new SimpleDateFormat(format).parse(date); Exception in thread “m…

Java Package Does Not Exist Error

So there’s a folder /usr/share/stuff in the root directory in stuff there are a bunch of java files with package org.name definitions at the top I am running javac test.java where test.java is in a subdomain I added /usr/share/stuff to my class path. and at the top of test.java I add import org.name But…

How do I remap the NumLock key in Java Swing?

You may have read my earlier question about remapping my keyboard at a low level in Java and I did find a solution – mostly. To be honest, I oversimplified the problem I was trying to solve. I not only want to match NumericKeypad 1-3 to 7-9 and vice versa, I want to remap the whole numeric keypad. In pa…