Help coderanch get a
new server
by contributing to the fundraiser

Maneesh Godbole

+ Follow
since Jul 26, 2007
Maneesh likes ...
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Maneesh Godbole

Paul is indeed right. The content pane defaults to BorderLayout whereas the JPanel defaults to FlowLayout.
Solution: Define your panel to have BorderLayout either via an explicit call or inside a constructor
7 years ago

Waylon Wolf wrote:my question is what could possibly go wrong if I drop the interface and write the code like this? The DynamicDataSet and SnapshotDataSet will function as the same right?

Did you try it out? Did it work?
7 years ago
IMO, for the OP the GridLayout with multiple JPanels might be better than overriding paintComponent. The panels can be referred to via index (2,5) which would closely match the existing "positions"
The game items can be JLabel with the image. Since a JComponent can be added only once to the parent container, it would be very easy to "move" the item.
7 years ago
Found this on 9gag.
7 years ago
Disclaimer: I haven't read OCA Java SE 8 Study Guide Edit subject

What is the the lowest value of hourOfDay? Zero or one?
Based on

prints between 11 and 23, inclusive

which would indicate zero. So noon will be 11.

In case it is so, and you are thinking why, it is probably because of the norm that the 1st element in an array or list has the index 0 and not 1
My suggestion:
Stop using all these text fields. Modify your code to use only one. Once it's working properly as expected, add the rest of the fields.
7 years ago
There is no pressing need to maintain an array/list of the checkboxes. The Container (which JPanel subclasses) has convenient methods to get all the child components. These can be used to confirm JCheckBox instance and manipulate the selection state as required
7 years ago
Is your jar self executable?
Does the manifest file contain such an entry?

More info about it here
7 years ago
Try running it from the command line.
Open terminal window
Navigate to jar file location
Type java -jar {jar_file_name}.jar
Hit return

The console window will tell you what went wrong. You can copy paste the output here (please UseCodeTags) so we can take a look
7 years ago

Junilu Lacar wrote:
I sure hope not. This is the kind of thing that can drive developers to madness, literally.

You can bet the management is going to love it then. I have lost quite a bit of hair and mental peace over maven already!  
7 years ago
Never heard of it. Found this

The example precondition ensures that the argument f of function sqrt() is greater than or equal to zero. Clients who use that method are responsible for adhering to that precondition. If they don't, we as implementors of sqrt() are simply not responsible for the consequences.

Laughed a lot over that part in bold. Sounds like bureaucratic lingo to me.
Oh you got an exception? Its your fault for passing illegal values. I was too lazy to code in proper checks. Instead I wrote a javadoc comment.

7 years ago
I understood the requirement as

7 years ago
One way to achieve this keep a track of the last time action was performed (via System#currentTimeMillis()) Then check if the prescribed interval has elapsed before executing the next time
7 years ago
I use this Resource Bundle Editor for Eclipse

You might want to consider something similar for Netbeans. Such editors are much more easy to use than editing multiple files manually.
7 years ago