- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 17
- Posts with Upvotes
- 17
- Upvoting Members
- 13
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Have nothing to say.
- Interests
- Playing Music, Movie freak...
- PC Specs
- Macbook pro
Hi! I'm sitting with a gui bug that I have been stuck with for a while. When a "view" is changed from one "view" to another, the new "view" doesn't get painted properly. The previous view is visibile randomly in the background. I can't reproduce this in the dev environment … | |
Hi! I'm having an issue with maven I can't figure out. I have two local projects, project1 and project2. Project1 has project2 as a dependecy as you would have any dependecy in maven declared. Everytime I make a change in project2 I have to install it into the local repository … | |
Re: First step to unit testing is to make your code testable. I'll give you one example. In your mouseReleased method you have a lot of code that does some calculations and set some variables. What you could do here to make the code more testable is to move out the … | |
Re: This is a super non-trivial problem. Not just a matter of providing an algorithm. But I'm guessing your looking for a library providing eye tracking implementations. A quick google of "eye tracking java" gave me this: http://lmgtfy.com/?q=eye+tracking+java which lead me to this: http://code.google.com/p/experteyes/ which might be interesting. | |
Re: Hi! First off, use of JApplet is prefferable over Applet since it supports Swing component architecture. So let your BallWorld class extend JApplet instead, it is essentially the same thing. Then you should maybe override the init() method in your BallWorld class to set up you applet. You should instansiate … | |
Re: Can you be more specific? How do you setup your JTable? I'm pretty sure there is no limitation to how many rows a JTable can display. | |
| Re: something like this should work... File rootDir = new File("/Path/to/dir/"); File[] filesAndDirectories = rootDir.listFiles(); the filesAndDirectories array contains everything in rootDir. You can search for filename given a regexp or something, go down to another directory etc... |
Hi! I'm working with a huge software system with a lot of people being involved in the coding through many years. I'm noticing more and more that there is a lot of bad code, especially get methods here and there with huge side effects, which you totally not expect. So … | |
Re: read: http://docs.oracle.com/javase/tutorial/uiswing/components/list.html under "Writing a Custom Cell Renderer" | |
Re: First of, do you have to implement your own list? There a many list implementations in java. Recursive printing could look something like this. [code] public void print(SinglyLinkedList<E> list) { if ( list.size() == 0 ) return; // print first element in list // call print with a new list … | |
Hi! I think the title is quite clear, but is there a way (I'm using Xcode 4) to auto generate the methods defined in a c++ header file to a cpp file? I just want empty methods that are compatible with the definitions in the header. Can't find anything on … | |
Hi! I was wondering if there is a way to mock Date and Calendar objects for testing purposes. In other words I want to programatically be able to change what new Date() and new Calendar() etc. returns independent of the system date. Something like setting the date for the jvm … | |
Re: I work at a software company that makes retail enterprise systems. I started hereright out of the university and have been working for about a year. The first couple of moths they gave me some time to familiarize myself with the systems and the code. I started of with minimal … | |
I'm searching for a java library/framework that makes printing easier. By easier I mean something that makes it possible to layout and format text/images and other elements in a document by defining layouts in html/xml or something. I also want the layout to be decoupled from rendering so the document … | |
Re: What do you mean by ArrayList of three classes? You could create an ArrayList which hold Objects. Or maybe an interface class that the three classes have incommon. [code] public interface GeneralType { public void someMethod(); } // Use Object as the generic type and cast to something else later. … | |
Re: Your problem description is a little unclear, but, first I'm noticing that the program only will terminate if "N" is typed, everything else is going to result in another game loop. Secondly, the number you're guessing is going to be the same for every replay since a new number is … | |
Re: Well there is a java matlab interface: [url]http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html[/url] I haven't tried it myself but it looks promising. What is that you want to do with matlab that needs more user interface than matlab provides? Matlab has alot of plotting and presentation tools. You will still need to have a matlab … | |
Re: The first thing I'm noticing is that all your code is en the paint method. This method should only be overriden if you want to do custom painting like the painting you are doing in the beginning of the method. You should not add swing components to layouts etc. in … | |
Re: Something like this... [code] String input = "123"; int parsedInput = 0; try { parsedInput = Integer.parseInt(input); } catch(NumberFormatException nfe) { // Handle incorrect input } [/code] | |
Hi! I have a JScrollPane that contains a JPanel with a CardLayout, which in turn contains two JPanels with some labels and stuff. I want the contents of the ScrollPane/ViewPort to never exceed the width of the viewport. The problem I'm having is that when a label holds a lot … | |
Re: Can it be a plugin that you don't have in the new version of netbeans? Check what plugins that are active in the old version etc... | |
Hi! I'm having some problems with my build files while running junit tests via ant. The build worked fine until a couple of days ago when I got a "process fork failed" error message. Further down in the stack trace i got: Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_25\jre\bin\java.exe" … | |
Re: Sounds advanced. Do you want to implements some kind of robot with AI that walks your dog? | |
Re: You will have to elaborate the problem. | |
Re: Well, the basics are quite simple. In junit 4 you annotate your test methods like the following. Your class doesn't have to extend anything. [code] public class SimpleTest { @Test public void aTestCase() { //Some test code... } } [/code] In Junit 3 you method name has to end with … | |
Hi! I'm looking for a way to only run a few tests instead of all existings JUnit test cases in our automated build, which uses ant. I can't add @ignore annotations in the code since it would take to much time. Is there a way to define which test cases/classes … | |
Re: If your goal is to represent a number with n significant decimals, you should use BigDecimal instead of Double. If it's simply a formating issue, have a look at NumberFormat and its subclasses (DecimalFormat). | |
Re: You compile in the order of depenedency, I'm not sure if javac handles that in some way, try it or google. If ClassA depends on ClassB, compile ClassA first and then ClassB. To run you need your main class, i.e. the class where you have the method "public static void … | |
Re: I don't know what you mean here when you say constructor but I see no constructors in your code. A constructor resides in a class with the same name as the class. The default constructor is a constructor with no input parameters. In my opinion you should write a matrix … | |
Re: You need a way to read filenames in a directory or subdirectory. Easy to goole: [url]http://www.exampledepot.com/egs/java.io/GetFiles.html[/url] And then you just read the files one by one and extract the line you want by using, for instance, FileInputStream, BufferedReader etc... [url]http://docs.oracle.com/javase/6/docs/api/[/url] Read the javadocs and examples. [url]http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml[/url] |