I am trying to make a JTable that has column spans available. Specifically, I am looking to nest a JTable inside another JTable, and when the user clicks to view the nested table, it should expand to push down the rows below and fill the empty space. This is similar to what you see in MS Access where you can nest tables, and clicking the...
The method signature of a Java main method is:
public static void main(String[] args){
...
}
Is there a reason for this method to be static?
...
Dear all,
first thing to note is the serialVersionUID of a class implementing Interface Serializable
is not in question. What if we create a class that for example extends HttpServlet? It also should have a serialVersionUID. If someone knows that this object will never be serialized should he define it or add an annotation to suppress t...
Is the D language a credible alternative to Java and C++? What will it take to become a credible alternative? Should I bother learning it? Does it deserve evangelizing?
The main reason I ask is that with the new c++ standard (c++0x) almost here, its clear to me that the language has gone well past the point of no return with respect to ...
We have a large codebase that takes approx 12 minutes on the developer machines to auto-generate some Java 5 classes using JavaCC and then compiles all the classes as well as running the units test.
The project consists of multiple projects which can be built in groups, but we are aiming for a full a build in under 10 minutes
What tips...
I am working with a log of events where there are about 60 different "types" of events. Each event shares about 10 properties, and then there are subcategories of events that share various extra properties.
How I work with these events does depend on their type or what categorical interfaces they implement.
But it seems to be leading t...
One of my nasty (?) programming habits in C++ and Java is to always precede calls or accesses to members with a this. For example: this.process(this.event).
A few of my students commented on this, and I'm wondering if I am teaching bad habits.
My rationale is:
1) Makes code more readable — Easier to distinguish fields from local variab...
Suppose I have a date, i.e. year, month and day, as integers. What's a good (correct), concise and fairly readable algorithm for computing the ISO 8601 week number of the week the given date falls into? I have come across some truly horrendous code that makes me think surely there must be a better way.
I'm looking to do this in Java but...
If I have a java file or class file (*.class) how can I convert it to an .exe file?
I also need an installer for my program.
Is there is an open source program that can do that?
...
I have a self built JSP webapp and at the moment I'm using tomcats built in admin pannel to manage user accounts (that are stored in tomcats config xml files) but this is limited because i can not create new accounts from within the web-app (eg. I can not have a sign up website) and need to manually create the accounts.
What is the mos...
It is much more convenient and cleaner to use a single statement like
import java.awt.*;
then to import a bunch of individual classes
import java.awt.Panel;
import java.awt.Graphics;
import java.awt.Canvas;
...
What is wrong with using a wild card in the import statement?
...
PMD would report a violation for:
ArrayList<Object> list = new ArrayList<Object>();
The violation was "Avoid using implementation types like 'ArrayList'; use the interface instead".
The following line would correct the violation:
List<Object> list = new ArrayList<Object>();
Why should the latter with List be used instead of ArrayL...
I made a Java Applet with some Standard GUI Components on it. I used the MigLayout Manager.
If I move the mouse slowly over the various GUI Components everything appears to be fine, but if I move the mouse fast, it flickers.
What could make that nasty ugly redraw?
(Core 2 Duo 6300, 2GB Ram, Windows XP)
...
After solving my flicker issue, I wonder if there is a better closable Tabbed Pane, then the one that pops up on top by googling for closabletappedpane?
(you recognize it by its processMouseEvents Method)
I especially need one, that never flickers :-)
Please post your experience, links with your own closable Tabbed Panes here.
...
I have the problem that an specific step in Ant can only be executed when we have Java 1.5 installed in the build computer. The task definition uses uses a jar file that was compiled using 1.5, so running with a 1.4 virtual machine will throw an IncompatibleClassVersion exception.
I have to find a solution meanwhile to have this task ...
I have one hibernate sequence, that generates all sequence-numbers in my app. When I generate the schemas from hibernate (target Oracle10), it genererates:
create sequence hibernate_sequence;
I would like to change the configuration of the sequence. I have to use something like:
create sequence hibernate_sequence order nocache;
I d...
Hello,
is there a tomahawk component, that enables "scrollable tabs"? What I mean is something for the following situation:
If I have very many tabs, the tab-bar gets a little arrow on the side to scroll through all the open tabs (like in firefox).
Is there a tomahawk component for creating something similar?
...
I have created my own Tree implementation for various reasons and have come up with two classes, a 'base' class that is a generic tree node that is chock full of logic and another class that extends that one which is more specialised.
In my base class certain methods involve instantiating new tree nodes (e.g. adding children). These ins...
Should be pretty simple: I have an InputStream where I want to peek at (not read) the first two bytes, i.e. I want the "current position" of the InputStream to stil be at 0 after my peeking. What is the best and safest way to do this?
Answer - As I had suspected, the solution was to wrap it in a BufferedInputStream which offers markabil...
Hi guys,
last time I asked how to populate a data structure here. Now I would like to know if there's something in Java, like the print_r I use in PHP, to represent what I have populated in the Maps and lists without having to do my own algorithm.
Any ideas?
...