System.out.println output to JTextArea
Hello, I would like to everytime I call System.out.println to append to a given JTextArea, without having to change all calls to System.out.println... Is this possible? Thank you. ...
Hello, I would like to everytime I call System.out.println to append to a given JTextArea, without having to change all calls to System.out.println... Is this possible? Thank you. ...
Just wondering if anyone has had any experience with installing hardware drivers via a Java Applet. I'm currently writing an applet that will be accessing some hardware and will be embedded into a web page. In order to make things easier for end users I would like to have it detect if the drivers are installed and if not install them. ...
I got this error: cannot access javax.el.ELContext class file for javax.el.ELContext not found I'm using Tomcat 6.0.20 and Mojarra JSF 1.2_13-b01-FCS. What class am I missing? Please help. ...
Hi all, I've a problem: my application must convert ms word documents (imported from another system) into rtf documents, in order to be manipulated with OOo APIs and to be immune from mistakes (for coding incompatibility reasons). I ask you: how can I manipulate ms word documents directly from my Java application? There are APIs (like...
I think I figure out what question I am trying to ask I dont want get(Calendar.MONTH) I want the month not to be greater than the last caldendar month that is why i am doing month -1, i realize that if i use get(calendar.MONTH) it is getting month of november I just want to see check and make sure its not a greater then the december to u...
I wonder not only what is Facet but also what is Facet 'in physical level' (as I understand it's not a separate jar, but what?)? I also wonder how can it affect my application after deploying. I'll explain on real example: I had 2 facets (which were created by IDE): Spring Facet and Web Facet (for jsf). I deployed it to Tomcat and my a...
Hello, i want to display a jtable with the feature, that if there is not enough space left on the screen the columns first start to shrink (and display less info) and then start to disappear. The info contained in the removed column for the selected row has to be displayed in a details view. Is there a component in any swing component...
Can't figure out this generics problem. I have these interfaces: public interface LoadableObject { } public interface LoadableObjectFactory<T> { } And now I want to do this: public class ObjectReference<T extends LoadableObject> { Class<? extends LoadableObjectFactory<T>> _cls; public ObjectReference(LoadableObjectFactory<T>...
Hello, I've been using JakartaFtpWrapper to upload files from the client Java application to my server (for backup purposes). The files that are uploaded are text files, png files and jpgs. I've noticed that the jpg files which are valid on the local machine - somehow become unreadable (corrupt files) on the server (where they were FT...
Hi, I'm trying to delete an item from an array list by selecting it from a JList and clicking "Delete"...... The code i have so far is buttondeleteContact.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { if (contactList.getSelectedIndex() != -1) { people.removeElementAt(contactLis...
Can anyone provide me test cases in java in which objects are being incrementally created so that i can use those to test my MarkSweep garbage collection code. ...
Lets say I have a java package commands which contains classes that all inherit from ICommand can I get all of those classes somehow? I'm locking for something among the lines of: Package p = Package.getPackage("commands"); Class<ICommand>[] c = p.getAllPackagedClasses(); //not real Is something like that possible? ...
I saw there is a daemon thread running whenever we create a referenced object using any Reference class like WeakReference, FinalReference, SoftReference, PhantomReference, Referemce And if we have hierarchal thread structure then at each level there is an extra daemon thread initiated. ...
I've created a small gui app in Netbeans. As I was adding in some buttons and text areas the mainPanel resized itself. Now it is really wide [probably 4x as wide as I want] but when I try to drag the edge in it won't resize back down. If I drag it out, making it bigger, it takes that change. I would just like to return the mainPanel back...
Or a better way than this? String concat(String[] strings) { StringBuilder out = new StringBuilder(); for(String next: strings) { out.append(next); } return out.toString(); } No worries if no, I just feel like there should be a built in? ...
How does one parse the mail files generated on a Linux system using Java? I mean, I want to be able to extract the From, To, Timestamp and Subject of the various emails inside the file. Any suggestions? ...
How can I make an option accept only some specified values like in the following example: $ java -jar Mumu.jar -a foo OK $ java -jar Mumu.jar -a bar OK $ java -jar Mumu.jar -a foobar foobar is not a valid value for -a ...
I can easily control a console based app with the input and output streams from Java's Runtime.exec() method. How would I control a GUI based application in the same manner. I have looked at the Robot class, but there is no way for me to control one application programmatically. Is there another Java library, or even another language's l...
I had some tests working fine. Then, I moved it to a different package, and am now getting errors. Here is the code: import static org.junit.Assert.*; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.jgrapht.Graphs; import org.jgrapht.WeightedGraph; import org.jgrapht.graph.DefaultWeightedEdge; import or...
I'm using the Netbeans GUI builder, but it's a little confusing now. How can I add an image to a panel? I think i'm doing it correct, but it's not showing up. I think it should be in the init() method, but netbeans does not allow me to change that part of the code. This is the code I added for the image: //these four lines I added to...