32,199 Topics
| |
Hey all - yes, this is another thread asking for some homework help, but I've got a solid start, just looking for some fresh ideas. Anyways, the task is to create a java clock class and access/use it from a driver. I saw something similar on here, but not quite … | |
I need to write a combination of String and Images to a file. The catch is that I have to write some String, then the Image, then more String again. Does anyone have any ideas how to do this? Should I use BufferedImage? | |
Hi, I need to create an adjacency list for a weighted graph. The input is given from a text file. I have created an array assigning each index a vertex. Now i have to link that array with a linked list. For example, vertex 'a' showing all the vertices that … | |
I am trying to write a method that will return the month with the lowest rainfall amount. The problem is that I have to initialize my variable but then my method always returns a "0". How can I fix this problem? Here is my code: public int getLowestRainFallMonth() { double … | |
[QUOTE] Please! need help in removing (or set the element value to 0) one element of an array based on the string value that is passed to the remove method. The array contains string names read from a file. I don't know if I should post the entire code on … | |
As The title says pretty much, auto resize and auto format are making this very hard for me to make GUI, can I turn it off? | |
Hi, I can't figure out why my exit button is not working as all the other buttons in my code seem to be working. I have given the code below. The constructor for the button is [code=Java] private JButton exit; .... add(exit); .... exit = new JButton("Exit"); exit.addActionListener(this); [/code] The … | |
I have two different parts to my program. My FundRaising.java is my problem. I'm having problems with my print statements. Why are the correct numbers not showing up? I keep getting 0. System.out.println (booster1); System.out.println (booster2); I ask the question to get the numbers and I keep on getting 0 … | |
I'm using [I]javax.xml.parsers.DocumentBuilderFactory[/I] to load an XML file. The file contains paired elements like so: <A></A> <B></B> <A></A> <B></B> <A></A> <B></B> So if I did the following: [code] Element element = <root node element> NodeList nodeListA = element.getElementsByTagName("A"); NodeList nodeListB = element.getElementsByTagName("B"); [/code] Can I assume the elements are in … | |
hey guys, im having problem converting this to a while loop. int lineB; int starB; for(lineB=1; lineB<=10;lineB++) { for(starB=10; starB>=lineB; starB--) System.out.print("*"); System.out.println(); } System.out.println(); Can it be written like this? int lineB=1; int starB=1; while(lineB<=10) { while(starB>=lineB) { StarB--; System.out.print("*"); System.out.println(); } lineB++; } | |
Hi, I downloaded the open source project Guitar Tuner ([url]http://sourceforge.net/projects/guitartuner/[/url]) Inside it there is an index.html file, a TunerApplet.jar file and a TunerApplet.java file (As well as some images and GPL etc.) When i open index.html the applet displays as it should however if I try to recompile (Even without … | |
I am doing a homework problem and am having a hard time understanding exactly how I should be doing this. Any nudge in the right direction would be helpful. :) The problem is as follows: Ship, CruiseShip, and CargoShip Classes Design a Ship class that the following members: • A … | |
Hello daniweb, I am new to java and am trying to wrap my head around parsing XML with Java. I've decided to try DOM with Xerces to start because it seems pretty simple, however I am getting NoClassDefFound errors. I'm sure it's something really simple that I have overlooked due … | |
The questions are at the bottom of the code. Need Java Help! I don't know what I'm doing or where to start!? Here is the first program: public class IntClass { private int x; public IntClass() { x = 0; } public IntClass(int num) { x = num; } public … | |
I'm working on a Floyd's Algorithm type Java program. What I have done so far is represent a directed graph in a 2d array, and I am trying to transform that into a 2d array representing the graph's paths of length 2. I planned for it to fill the adj2[][] … | |
OK i have been stuck with this particular problem and driving me crazy any insight would be helpful. I am trying to create a program that asks user for a string and using the scanner method count the instances it appears in a txt file below is the code oh … | |
Hello, In my project I have to capture screen activity (including audio) to a video file. I try using JMF for this. I don't know how to use those two classes: DataSource.java and LiveStream.java. I read them line by line. I probably have to create a Processor and feed it … | |
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 [U]to be immune from mistakes[/U] (for coding incompatibility reasons). I ask you: how can I manipulate ms word documents directly from my … | |
hello can someone help me out with these? am writing a project on a video rental store. and i have to use access i dont know if i should use one-many connection or many - many. if many-many then what will the code in the java database look like? remember … | |
I am trying to run a source code that I downloaded. However, there are several error message in reference to the classes TablePanel, BufferedPanel, Stringable, and Booleanview. I am not sure why I am getting these errors because it is a complete source code. Do I need to import additional … | |
Can you convert the object returned by jTable.getValueAt(Row,Col) to an integer? | |
Hi, In my program, a text file is read in, and certain parts of it are written to a XML file. There are special characters(e.g. &) that need to be escaped, so I need to escape all of them. How can I manage to do this? | |
[CODE]import java.util.Scanner; import java.util.Random; import java.io.IOException; import java.io.PrintWriter; import java.io.File; public class Password { public static void main(String [] args) { Scanner in; in = new Scanner(System.in); Random rand = new Random(); System.out.println(" Password Generation Menu "); System.out.println("********************************************************"); System.out.println("* [1] Lowercase Letters *"); System.out.println("* [2] Lowercase & Uppercase Letters *"); … | |
There were two other variation which I completed but I am confused with this one: Write a method for each triangle variation. Use nested for loops to draw the triangles. Variation 3: /** Precondition: width is an odd number >1*/ public void diamond (int width) { } if width = … | |
I have drawn a cirlce and 2 line which intersects the circle using 2D Graphics. Now I want to draw an arc between the intersection point. The attached pic can show very clearly wht i want. The black portion is drawn. The red part is to be drawn. The radius … | |
I get a ArrayIndexOutOfBoundsException. The cause is this snippet: [CODE]public static void main(String[] args) { //command line param try { [B]if (args[0] != null) {[/B] if (args[0].equals("printer")) { printToFile = false; } } } catch (Exception oob) { oob.printStackTrace(); }[/CODE] I don't give the program any parameters when I start … | |
The section of my code that is commented out is what I need help with. I am wanting to check the user input of binary for anything other than a 1 or 0. Also, it will only accept an input of 10 numerical characters or less. I am wondering if … | |
Hi, I'm trying to find a suitable language for developing an RIA to be able to tune an instrument via a website. I.E. what I need is: 1) Live input from a microphone 2) Get the volume level of different frequencies 3) Find the average or loudest frequency 4) Output … | |
I am trying to implement an interface so that the main program would work. Any light? I am having a difficult time trying to understand interface :/ [code] interface ArithmeticOperator { // Returns the result of applying the operator to operands a and b. double operate (double a, double b); … | |
The fact thats it an AVL tree probably doesn't matter. I have a printTree method in my tree class and I'm trying to print the nodes in the form of the tree. I've successfully printed the nodes the correct way but now I'm trying to label the nodes by their … |
The End.