32,204 Topics
| |
I used one action listener for an array of buttons that do different things. Exploring methods. I am fairly new to java. I just made a tic tac toe program. I am hoping for people to look it over and tell me what they think, ways to make it better, … | |
String<ArrayList> selitems; String<ArrayList> cartitems; what are the possible mistakes? | |
[code]import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import javax.servlet.http.HttpSession; import java.util.ArrayList; import java.util.StringTokenizer; import java.io.PrintWriter; import java.io.IOException; import java.text.DecimalFormat; public class ShoppingServ extends HttpServlet { String link; String[] books; String[] music; String[] computers; String<ArrayList> selitems; // JAVA.STRING.LANG doesnot take parameters error String<ArrayList> cartitems ;// JAVA.STRING.LANG doesnot take parameters error … | |
I need to run some code written in Java from my personal website. How do I even begin? | |
I am making a game where random obstacles appear. The obstacles will move towards you. I currently have this code to animate the obstacles. [CODE] for (int i = 0; i < obstacle.size(); i++){ // animate walls obstacle.elementAt(i).x -= 1; } [/CODE] My vector multiple instances of the Walls class … | |
My panel's paintcomponent method draws a line based on the initial click and the current position as the mouse is dragged. Releasing the mouse leaves one line from the mouse press location to the mouse released location. The problem is. on the next click/drag, the old line disappears when the … | |
Hello all. I have to write a java program that allows a user to enter an octal digit and output the binary equivalent for as many numbers as the person wishes using a direct access method. The error is that even though it compiles, the answer (the binary number) continuously … | |
Hey, I'm getting this error every time I run my program. I dunno what it means and how to fix it. [code] Uncaught error fetching image: java.lang.NullPointerException at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99) at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:113) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) [/code] | |
1)DEFINITION OF DATA REQUIREMENTS Produce an itemised consigment note for each customer including -dimension,weight and price per parcel. -total weight and price consigment -number of parcels RESIDENT DATA -up to 2kg-£7.50 -up to 4kg-£8.00 -up to 10kg-£8.55 -up to 12kg-£9.10 -up to 14kg-£9.70 -up to 16kg-£10.35 -for each extra 2kg,up … | |
[code] public class exception4{ public static void method(){ try{ exception4.method2(); throw new Exception("method throw"); } catch(Exception e) { System.out.println("method Exception caught"+ e); //throw e; } } public static void method2(){ try{ throw new Exception("method2 throw"); } catch(Exception e) { System.out.println("method2 Exception caught"+ e); e.printStackTrace(); [COLOR="Red"][B]//throw e; [/B][/COLOR] [COLOR="Green"][U]if include this … | |
I need to know how I can set up a action listener for an array of buttons. I am trying to make a tic tac toe game. I am new to programming. I have seen someone on here ask a similar question but I could not grasp what they where … | |
we are ordered to create a payslip in applet but I am not able to create one for I do not know compute the gross pay, net pay and total deduction.....also I do not know the relation of the days worked,overtime worked and overtime rate to the gross pay......what should … | |
I have created my own payslip but then when I compiled it, they said that there are no more errors but I cannot view my output on the applet viewer............ is there something wrong with my code or is the viewer at fault here?? here is my code............ [CODE]import javax.swing.*; … | |
[B]Could u tell me why the following problem is coming on running the program where im getting the out twice each time wen i shd get it only once , wen im entering a input im getting the menu twice[/B] [CODE]import java.io.*; class Television{ private String MANUFACTURER; private int SCREEN_SIZE; … | |
plzz help me how can i do the 3 sorting in 1 program user input using bufferedReader plzzz... bubble sort slection sort insertion sort | |
I am making a program where i have to write a recursive function that reverses a string. I am a new programmer and need help. The function should return a String and take only one argument, also a String. [CODE]import java.io.*; public class RecursiveFunction { public static void main(String [] … | |
Just wondering is there any way to modify Classpath in your program and force them to include a new directory in classpath ?? | |
im not able to figure out the meaning of this piece of code: [code] public int void countTokens(String s) { StringTokenizer st= new StringTokenizer(); return st.countTokens(); } [/code] | |
Am trying to create a JTable application but when i try to run the program in netbeans it bring an error on the addRow() and removeRow() and yet when i run it in the commandPrompt it works well what could be the problem. below is a snippet of the code … | |
Hi im trying to design a program that matches wildcards example the * , ?, [], {} etc but ive read that java has its own regex support I want to manually code the matching idont know where to start or how to do the program/ design it. Can you … | |
I want to have two textfields which will have the following validations 1) Both should be Integers 2) The value in one textfield should be a integer multiple of other I have used two JFormattedTextFields to this. This is what i have done till now [CODE] NumberFormat updateFormat,sampleFormat; updateFormat = … | |
Hi, I desperately need help for my java assignment. I am required to make an encryption/decryption program using netbeans. It basically takes the users message and encrypts it into characters and vice versa for decryption. My teacher say it has something to do with using arrays. There are 2 main … | |
Hello, I have the current sample xml document below: [CODE]<Units> <category name="Temp"> <unit id="0"> <unit_name>celcius</unit_name> <fromFormula>inFrom0</fromFormula> <-- need this value <toFormula>inTo0</toFormula> </unit> <unit id="1"> <unit_name>fahrenheit</unit_name> <fromFormula>inFrom1</fromFormula> <toFormula>inTo1</toFormula> </unit> </category> <category name="Length"> <unit id="0"> <unit_name>feet</unit_name> <fromFormula>InLengthFrom</fromFormula> <toFormula>inLenghTo</toFormula> </unit> </category> </Units>[/CODE] Now, I am trying to retrieve the value "inFrom0" from the … | |
help im new to this.... why are get method useful?? for example why write this: [CODE]public class name { private String yourname; public void setname(String Fname){ yourname= Fname; } public String getname(){ return yourname; } public void sayying(){ System.out.printf("hello %s", getname()); } }[/CODE] when this also does the same thing … | |
So I'm creating a program that calculates the “Sum of Powers” after the user inputs two integers N and M. The sum of powers is computed as N^M+ N^(M-1)+ N^(M-2)….+N^0. But I don't know how to finish it. I'm kinda confused using return method, loops, etc. Here's what I have … | |
I am trying to write a sample program that can call use the main method of "SequenceFilesFromDirectory", which aims to convert a set of files into sequence file format. [CODE]public class TestSequenceFileConverter { public static void main(String args[]){ String inputDir = "inputDir"; String outputDir = "outoutDir"; SequenceFilesFromDirectory.main(new String[] {"--input", inputDir.toString(), … | |
I am a VB.net programmer and I am very new to PHP HTML and Java Scripts I am doing a project for my company using PHP HTML and Java Scripts and I want to Know how to make readonly a text box after it gets the input This text box … |
The End.