Hi,
I have a JFrame. This JFrame contains a JButton. I click the JButton and 10 JTextFields are created.
the problem:
I cannot see them until "I force a repaint()" by resizing the window. Only then do I see the JTextFields created.
CODE:
JPanel points = new JPanel();
//Creating the JTextFields:
for (int i=0; i<10; i++) {
JTextFie...
Hi,
The GUI for managing plugins in Eclipse got a bit of an overhaul in version 3.4.0.
This GUI is accessed via the "Software Updates..." option in the Help menu.
This displays the following dialog:
Notice that the option to remove the selected plugin (Mylyn) is greyed out. In fact, this is true of virtually every installed plugin. ...
Hi,
I recently upgraded to the latest version of Eclipse (3.4.1). It appears that the unused code detector plugin doesn't work with this version. When I try running it, I get the error message:
Problems running UCDetector. Check
error log No enum const class
org.ucdetector.preferences.WarnLevel.Ignore
Has anyone else had this ...
Using Java, I need to encode a Map<String, String> of name value pairs to store into a String, and be able to decode it again. These will be stored in a database column, and will probably usually be short and simple, so the common case should produce a simple nice looking line, but shouldn't corrupt the data, even if it contains unexpe...
As the title suggests what is a good debugger for Java? I've come from a C/C++/Ada background so I've become very accustomed to gdb :). On the java side I've only used jdb and jswat but I would like to ask what java debugger do you recomend and why.
Some background: I'll be using the debugger to debug a Swing Applications running on ( a...
How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application?
...
I've been working with Java GUI for a while now but the whole model/structure of JFrames, paint(), super, etc is all murky in my mind.
I need a clear explanation or link that will explain how the whole GUI system is organized.
stackoverflow-ers: can you help me?
Thanks everyone, some more answers would be better but this is great!
...
I have a JPanel full of JTextFields...
for (int i=0; i<maxPoints; i++) {
JTextField textField = new JTextField();
points.add(textField);
}
How do I later get the JTextFields in that JPanel? Like if I want their values with
TextField.getText();
Thanks
...
I have a JTable with a custom TableModel called DataTableModel. I initialized the table with a set of column names and no data as follows:
books = new JTable(new DataTableModel(new Vector<Vector<String>>(), title2));
JScrollPane scroll1 = new JScrollPane(books);
scroll1.setEnabled(true);
scroll1.setVisible(true);
JSplitPane jsp1 = new J...
In a bunch o' places in my code, I have something like this:
public Class mySpecialMethod() {
return MySpecialClass.class;
}
which causes the warning
Class is a raw type. References to
generic type Class should be
parameterized.
But, if I replace
Class
with
Class<? extends Object>
the warning goes away.
Is this ...
I have a java class which fires custom java events. The structure of the code is the following:
public class AEvent extends EventObject {
...
}
public interface AListener extends EventListener {
public void event1(AEvent event);
}
public class A {
public synchronized void addAListener(AListener l) {
..
}
public synchroni...
Hey
I fail to understand why this code won't compile
ExecutorService executor = new ScheduledThreadPoolExecutor(threads);
class DocFeeder implements Callable<Boolean> {....}
...
List<DocFeeder> list = new LinkedList<DocFeeder>();
list.add(new DocFeeder(1));
...
executor.invokeAll(list);
The error msg is:
The method invokeAll(Col...
Apologies for the long post, but I wonder if I could get some more eyeballs on this before I submit a bug report to Sun.
JVM: 6u11
O/S: Windows XP SP3
Hardware: AMD Athlon 64 X2 4600+ @ 2.41GHz, with 3.25 GB RAM.
I believe I have encountered a fault in the JVM where no thread is given a monitor. In the following thread traces, the mon...
Hi,
i'm begginner in java,
i have textarea and i have set only verticle scrollbar to that textarea.i'm appending data for every 1 minute to textarea,problem is when new data appends to the textarea scrollbar will move up.To see the new data,every time i have to drag the scroll bar, that is not the requirment.i want scrollbar should not m...
I am using a class Foo that provides these methods:
String overloadedMethod(Object)
String overloadedMethod(Goo)
Since Java statically dispatches on the non-receiver argument, I cannot just pass my value (which is an Object, but might have dynamic type Goo) and rely on the JVM to dynamically choose the "correct" method.
This is my cu...
I'm getting a NullPointerException in a Class from a 3rd party library. Now I'd like to debug the whole thing and I would need to know from which object the class is held. But it seems to me that I cannot set a breakpoint in a Class from a 3rd party.
Does anyone know a way out of my trouble? Of course I'm using Eclipse as my IDE.
Upda...
I want to build an SQL string to do database manipulation (updates, deletes, inserts, selects, that sort of thing) - instead of the awful string concat method using millions of "+"'s and quotes which is unreadable at best - there must be a better way.
I did think of using MessageFormat - but its supposed to be used for user messages, ...
Anytime I have to handle dates/times in java it makes me sad
I'm trying to parse a string and turn it into a date object to insert in a preparepared statement. I've been trying to get this working but am having no luck. I also get the helpful error message when I go to compile the class.
"Exception in thread "main" java.lang.Error: Un...
Does anyone know how to get a service ticket from the Key Distribution Center (KDC) using the Java GSS-API?
I have a thick-client-application that first authenticates via JAAS using the Krb5LoginModule to fetch the TGT from the ticket cache (background: Windows e.g. uses a kerberos implementation and stores the ticket granting ticket in...
The question is in Java why can't I define an abstract static method? for example
abstract class foo {
abstract void bar( ); // <-- this is ok
abstract static void bar2(); //<-- this isn't why?
}
...