32,204 Topics
| |
i dont know whats wrong with this program...the compiler compiles the program but when i run it it shows: j[B]ohnrambo@ubuntu:~/Desktop$ java lora Exception in thread "main" java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:443) at lunda.l2read(lora.java:24) at lora.main(lora.java:124)[/B] [CODE] class lunda{ String[] la=new String[2048]; String[] lb=new String[2048]; int[] lvalid_a=new int[2048]; int[] lvalid_b=new int[2048]; int[] … | |
can anybody help me what is wrong in syntax of following [CODE]ihex=Integer.parseInt(s5,16); String bin=Integer.toBinaryString(ihex); System.out.println(bin); if(bin.length()-10 > 0) String orgpc=bin.substring(bin.length()-10); else String orgpc=new String(bin);[/CODE] this is what compiler shows [B]nchy@ubuntu:~/Desktop$ javac bpbc.java bpbc.java:61: error: Syntax error on token "orgpc", delete this token String orgpc=bin.substring(bin.length()-10); ^^^^^ bpbc.java:63: error: Syntax error, insert … | |
[CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class ClientProgram implements ActionListener{ //static FilmCollection collection = new FilmCollection(); static boolean condition = true; static int memberPassword = 123; static JButton button1, button2, button3; public static void main(String[] args){ int mPassword; JFrame myFrame = new JFrame("Member Login"); //window's title myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//perform exit when … | |
I am writing a Java program, a MP3 Manager, but I have problems to work with buttons, TextFields, and TextArea. Here are the problem descriptions. Create a class MP3 with instance variables for: artist, song, album, track length (in seconds). Provide a constructor, get/set methods, and a toString. method. The … | |
I have this assignment where I have to make an xml that has movies names and info. Then i have to make a StAX program that locates the xml file and reads it. The program should also be able to count the number of movies in the decade. Thats the … | |
hello guys im tryingg to write a program which will generate an aeiou grid...if the program finds two consecutive vovels in a sentence then it will thake the first vowel as the row and second one as the column reference ...and do a +1 in that location i seem to … | |
Hello, I have Googled this for days, but couldn't find a suitable code/tutorial. I need to write a simple java webservice that would return a XML/JSON file as its output. For example say there's a button, and when i click on it, it should run a SQL [CODE]select * from … | |
Hey all. I am completely stuck here. I want to implement a round robin based service capable of load balancing http requests. ATM I have a thread with an infinite loop which listens for TCP connections. When it finds a connection, it runs another thread which will process the request. … | |
I know this is an OLD thread, but i"m having the same problem. a Runtime error when trying to "OPEN" a file. [CODE]public void actionPerformed( ActionEvent evt) { //filterMap.put(evt.getActionCommand(), ((JCheckBox)evt.getSource()).isSelected()); if(evt.getActionCommand().equals("export")){ String file2Read; file2Read = fileIN.getText(); //file2Read = "NotConverted2.xls"; new BPSepcExporter().BPSReader(file2Read); } //If to check if Open button was hit … | |
Hi, Does anyone know a method or some code to find out whether two numbers have at least one common factor? I currently have a gcd method that finds the greatest common divisor between two numbers however an arithmetic exception is thrown if the two numbers have no common divisor. … | |
i have a project ,and i don't know how to run it in netbean ide - i am a begineer in java2e - i got a project in which some notepad like screen is there when running -jar exe file - and a option is there for compile and running … | |
Can anyone see what's wrong with this piece of code? When I try to compile I get an error on the first line (line 3) "cannot find symbol, symbol : method split(char)" I have the delimiter btw as a public static final char in the same class. [CODE]private static boolean … | |
This is my jsp code for saving back the data to .properties file after editing. i used 2 Linked properties as one LinkedProperties pro is to get the data from the path and the other one to get attribute (eg: id, name, age, gender etc.) from default .properties file so … | |
Basically what I want to do is add a prefix (input by the user) to be added on a chosen word by the user. Is that posible? I got stuck and don't know what to do.... Here's what I have so far. [CODE]// The "Prototype" class. import java.awt.*; import hsa.Console; … | |
Guys i wanted to connect Java Application with MySql database.I have written a Java Programme.I have already created the database also.But it doesn't connect with the Database.This is my code.[CODE]import java.sql.*; public class check { public static void main (String[] args) { Connection conn = null; try { String userName … | |
My question is about looping skill overall. I am having problems with loops. Is there any book/tutorial/website about this particular skill in java programming to help me learn how to loop in correct/effective way ? I know how to write simple loops, I know structures of loops too. When I … | |
Hello I want to make a GUI, and for it I need to use absolute positioning, since I want each element to have a precise position within my frame. I am making each element that makes up the frame by extending JPanels, so I'm building each block within the window … | |
i have two array of chars of size 12 each having only 0's or 1's. what i am trying to do is that in for loop [CODE]for(i=0;i<12;i++) { int a=1starray[i]; int b=2ndarray[i]; int c=a^b }[/CODE] but every time c gets 0 only. iam not getting it why. can anybody help … | |
Hi everyone, First off - I'm very new to Java so please be gentle. I'm having some problems with an assignment from school: [B]Input[/B] The input starts with an integer k indicating the number of words in the text (max 1000), followed by k words. [B]Output[/B] The output will consist … | |
I can add nodes to my JTree, but after expanding a node, I can not add any child nodes to that node, or at least they dont show on the screen? Actually I can use the .add(new DefaultMutableTreeNode("Label")); to add a node to a parent node, but the new child … | |
I need help with a lab I'm doing. In this lab you have to show the number of odd digits a number has, for example the number 4135 would have three odd digits. I've already done a lab where it tells you if a number is odd or even but … | |
I'm trying to write this program that'll generate 10 random values in a given range, store these numbers in a .txt file, and then read these numbers from the same file and display them on the screen with equivalent words. I've got to the part where im trying to read … | |
Guys i have developed a java desktop application.There is a jTable.I have already connected the MySql database also.I just want to bind the data of database to my jTable.In several tutorials i saw when right click on the jtable,get a dropdown menu and select the table contents and go step … | |
Initially I was to design this simple program to have a file be read in and store 50 numbers in array1, and the last 50 numbers in array2, then calculate a total (array1 + array2) and store it in array3. But I need to change this program to utilize the … | |
I have my two JTextFields identified in a GridLayout, but when I try to reformat them the stay as large as their positioning allows. I have tried to specify the size of the field but it never changes on the final product. Could this be because the GridLayout or something … | |
I have a program in which tells me the highest number and the lowest number. ( i am using a loop for the highest and lowest) I need to get the second highest and second lowest. without an array i was wondering if i could find that within the same … | |
How to create reports in core java like visual basic 6.0 report | |
Hello, I am a novice programmer and I was given the following task: write a Payroll class that uses the following arrays as fields : employeeId (holds 7 integers that are initialized, I placed them in my code below), hours and payRate (both are doubles and hold 7 numbers). I … | |
Okay getting quite frustrated! I am trying to get an if statement to implement a pop up window when the user fails to enter any information in one of the JTextFields like fnameTF. Here the if statement but where do I place it to work in my program? [CODE]if (fnameTF.getText().length() … | |
I would like to know how you can input information from one array to another. For example String A[] A[0]= 2, 54, 6, 7 A[1]= 434, 32, 45 A[2]= 34, 45 A[3]= 20 Where all that are in "A" are actually seen as strings, and you want to input this … |
The End.