32,199 Topics
| |
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 … | |
Unix server - function(). I want to call this function through java program and track the result. help me. | |
Hello everyone first of all thanks to daniweb and all users to help me lots of time. now come to problem i am learning java from last one month today i wrote a program to swap two objects it is running but not performing desired task. all instance fields are … | |
Hello everyone. I just started on 'converting' my multiplayer text RPG into a graphical form. What I am trying to do is this: Create a title window, basicly just a JPanel with one image filling the space. To this JPanel I add a MouseListener. When a user clicks the window … | |
Hi, I'm new in this forum and I'm here to ask help on a topic the lecture I didn't turn up. I'm new to creating a search function for my Java application where the user can view the information of the books, such as title, author and the price of … | |
Hi, I am fairly new to Java and am about to begin a programming course in the next week. I am preparing by completing exercises and am stuck on this particular one. Basically, i need to read a file in a certain format and calculate some figures and writing the … |
The End.