Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Maneesh Godbole

Bartender
+ Follow
since Jul 26, 2007
Maneesh likes ...
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
Pune, India
Cows and Likes
Cows
Total received
18
In last 30 days
0
Total given
54
Likes
Total received
959
Received in last 30 days
0
Total given
823
Given in last 30 days
0
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
1 year 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?
1 year 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.
1 year ago
Found this on 9gag.
1 year 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.
1 year 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
1 year ago
Is your jar self executable?
Does the manifest file contain such an entry?

More info about it here http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
1 year 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
1 year 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! 
1 year 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.

1 year ago
I understood the requirement as

1 year 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
1 year ago
I use this Resource Bundle Editor for Eclipse
https://sourceforge.net/projects/eclipse-rbe/

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