- Strength to Increase Rep
- +7
- 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
104 Posted Topics
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] | |
Re: I'm no neatbeans guy but try googling the producer consumer pattern, where your input form is the producer and the gauge and result components consumers. [URL="http://docs.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html"]http://docs.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html[/URL] | |
Re: In your method displayText(String s) you construct a JFrame and JTextArea for every call you make to it, which is for ever line you read. You should only construct these once, and hold the text you want to show in the textArea in a variable and just call textArea.setText(theText). | |
Re: Have you looked at the [URL="http://docs.oracle.com/javase/6/docs/api/java/awt/Shape.html"]Shape[/URL] interface, its implementing classes, and uses? I think [URL="http://docs.oracle.com/javase/6/docs/api/java/awt/geom/QuadCurve2D.Double.html"]QuadCurve2D.Double[/URL] is a cubic bezier curve. | |
Re: Remarkably that you had the time to create a forum account and post a new thread before googling, which takes 0.13 seconds to get an answer from. [url]http://www.google.com/search?client=safari&rls=en&q=java+static&ie=UTF-8&oe=UTF-8[/url] | |
Re: I'm not sure what the default method access is for getInfo(). Try adding public so it instead says: "public void getInfo() {". Also, your getInfo method does not return anything, which is bad code for a method with get in its name. You should either return something or call it … | |
Re: Is the file supposed to be readable, or just store the data for efficient processing? In the latter case, what difference does it make if you have new lines or how the file looks at all? It sound to me like you want to make a file that efficiently stores … | |
Re: I didn't go through your code that much, but why are you setting and getting lengths? Do you know that List has a method size(), which returns the number of objects in the list, i.e. the length? What length is it that your setting? | |
Re: It is kind of hard to get mouse event without events since the event is an event in its nature. Do you want to have like a while loop where you call a method getMouseInfo() that return the state of the mouse? An Event is just a callback method that … | |
Re: Programming isn't magic, every convievable method is not included in the java api. You need to write your own method for extracting alphabetic characters from a string. You can loop through the string, use tokenizers as said, use regular expressions to do something etc... And what du you mean by … | |
| |
Hi! I'm writing a unit test where arbitrary objects have to be created without knowing anything about the objects (with some exceptions). I use reflection to create objects and set their fields to random values etc... I'm almost there but I've come to an issue I can't find a solution … | |
Re: Why would directx be better? OpenGL will run on non windows platforms, directx will not. In my opinion both are as hard to learn, and are equally good for drawing shit on the display. Also OpenGL would be better learn if you want to do graphics for phones and stuff, … | |
Hi! I'm wondering if there is a tool to make the following functionality in an wasy way. I have a project in eclipse and I use perforce for versioning. I want to be able to compare the project between two dates and determine which classes/packages etc. that have been added … | |
Re: I'm not sure that I understand what you are after. The equation can have many solutions. Do you want to calculate the definition space and randomly select variables x,y... inside that space? What language are you using? It should be easy to find an algorithm that produces random uniform variables. | |
Hi! I'm looking for a way to make an application (app1), separate from another java application (app2), that can acces the GUI of app2 and also listen to all events that are passed to app2. I would like to be able to get hold of the frame of app2 so … | |
Hello! I've written some swing components for which I use timing framework to make some simple animations that hopefully are going to enchance usability. What I am doing is essentially setting the bounds of JPanels for each timing event to animate something that moves and resizes. I also change transparency … | |
Hello! I've made a custom JPanel that overrides paintComponent which paints a rounded rectangle. My problem is that when I place other components in the panel, like a JLabel, they don't get rounded corners like the panel they are in. here is my panel class: [code] private static class BackgroundPanel … | |
Hello! I have a swing app with lots of components and stuff. I want to place a Container/Jpanel on top of everyting else that is invisible that contains other component which are visible. I can make the panel invisible or not opaque and still show its child component but I … | |
Hello! I'm trying out an idea I had which requires me to capture the contents of a java window/Frame, much like a screenshot but without the window and menubar, just the contents rendered in java, i.e. an exact image of what is visible in the java application at the moment. … | |
Hello! I am writing an application for an embedded system with GUI written in swing. I now want to incorporate animations in the GUI to enhance usability. Hypothetical example: The user sees a table with some buttons ant things around it. The user can temporarily "save" the table, which makes … |
The End.