32,204 Topics

Member Avatar for
Member Avatar for nchy13

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[] …

Member Avatar for leodash
0
154
Member Avatar for nchy13

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 …

Member Avatar for nchy13
0
214
Member Avatar for gahhon

[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 …

Member Avatar for thines01
0
274
Member Avatar for Danielhuo

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 …

Member Avatar for Danielhuo
0
1K
Member Avatar for vishal1949

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 …

0
134
Member Avatar for sidd1994

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 …

Member Avatar for JamesCherrill
0
175
Member Avatar for localp

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 …

Member Avatar for ~s.o.s~
0
143
Member Avatar for MisterRaver

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. …

Member Avatar for NormR1
0
362
Member Avatar for th3b3n

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 …

Member Avatar for th3b3n
0
289
Member Avatar for BenzZz

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. …

Member Avatar for stevanity
0
3K
Member Avatar for deep1

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 …

Member Avatar for stultuske
0
96
Member Avatar for java.util

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 …

Member Avatar for java.util
0
2K
Member Avatar for kyraa

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 …

Member Avatar for peter_budo
0
113
Member Avatar for Daigan

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; …

Member Avatar for NormR1
0
153
Member Avatar for pro_learner

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 …

Member Avatar for harinath_2007
0
165
Member Avatar for bombay1982

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 …

Member Avatar for stultuske
0
1K
Member Avatar for geekman89

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 …

Member Avatar for geekman89
0
267
Member Avatar for nchy13

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 …

Member Avatar for nchy13
0
2K
Member Avatar for nixufix

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 …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Joncamp

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 …

Member Avatar for rocknroll60
0
230
Member Avatar for marifergarz

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 …

Member Avatar for stevanity
0
871
Member Avatar for nobert79

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 …

Member Avatar for thines01
0
149
Member Avatar for pro_learner

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 …

0
59
Member Avatar for TheSilentGiant

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 …

Member Avatar for thines01
0
172
Member Avatar for BDan

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 …

Member Avatar for BDan
0
161
Member Avatar for Kayneedshelp

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 …

Member Avatar for Ezzaral
0
237
Member Avatar for Pravinrasal
Member Avatar for brynFlew
0
119
Member Avatar for HardToHandle

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 …

Member Avatar for hfx642
0
383
Member Avatar for applejax77

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() …

Member Avatar for NormR1
0
1K
Member Avatar for yazz110

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 …

Member Avatar for NormR1
0
238

The End.