32,204 Topics

Member Avatar for
Member Avatar for capsitan

I am doing a payroll program that requires a sentinel value. I cant seem to get it right no matter how much I try. here is my code so far: //Filename: Payroll3.java //Description: Payroll calculator with sentinel loop //Author Name: Chris Russo //Date: 08/15/2010 import java.util.Scanner; public class Payroll3New { …

Member Avatar for tong1
0
157
Member Avatar for jk_bscomp

Hello, everyone!!! I just want to ask if you anyone here knows how to compile java file in linux specifically UBUNTU. For example, I have a java file named Hello.java and saved at my desktop. how do I compile and run this file using the terminal of ubuntu... By the …

Member Avatar for tong1
0
357
Member Avatar for playdaguigame

hi, i was supposed to write a program in jgrasp, using java, i am a grade 12 learner, my program needs to have gui, my program compiles with no errors, when i run it it gives me my error message - "problem with showdata" - and only fills the first …

Member Avatar for javaAddict
0
99
Member Avatar for herberwz

please me on how to insert a picture am new to netbeans [CODE]package LibraryDatabase; import static javax.swing.JOptionPane.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class PostLibraryDatabase extends JFrame implements ActionListener { JTextField firstName, surName, id, serialNumber, category, dateToday, coverTitle, isbnNumber, authoursName, coAuthoursName, pubDate, loanDate, returnedDate, email, details; JButton writeBtn, displayBtn, …

Member Avatar for herberwz
0
155
Member Avatar for DARK_BYTE

Hi I successfully wrote a program that keeps sending data from client to server and from server back to client where the client prints the data. But now I'm trying to write one whereby the user enter numbers at the client and they are sent to the server whereby they …

Member Avatar for JamesCherrill
0
101
Member Avatar for hazeeel

[CODE] coordinates1[i][0]= Double.parseDouble(text2.substring(30,38));//X coordinates1[i][1]= Double.parseDouble(text2.substring(38,46));//Y coordinates1[i][2]= Double.parseDouble(text2.substring(46,56));//Z [/CODE] How do I combine the above 3 into 1 2D array?

Member Avatar for javaAddict
0
28
Member Avatar for Xufyan

Is it possible to call a constructor if we entered know value in the output screen ??? example !! [CODE]import java.io.*; class Employee{ int num; static int count=0; float compensation; public void print(){ System.out.println ("Employee number: " + num + ", Employee Compensation: $" + compensation); } public Employee(){ num …

Member Avatar for group256
0
193
Member Avatar for rajasekhar1242

hi , i am trying to develop one jsp application with tag concept on netbeans tool. but i am getting this error "According to TLD or tagfile, Attribute uri is mandatory for tag dbquery " . i could not run my application due to this error. In Jsp file i …

Member Avatar for rajasekhar1242
0
163
Member Avatar for prem2

Hi, I have a doubt in overriding the methods in java. Sample program For overriding .This program executes fine. [code] import java.io.*; import java.util.*; class one { public void show(){ System.out.println("I am in class one-Super Class"); } } class two extends one { public void show(){ super.show(); System.out.println("The subclass two"); …

Member Avatar for tong1
0
99
Member Avatar for NewbyChic

Alright, Ive moved onto my next mission. I have to draw a set of four triangles using for loops. I have the first two done, the second two have to have spaces prior to printing the asterisks. example: ***** **** *** ** * * ** *** **** ***** This is …

Member Avatar for javaAddict
0
173
Member Avatar for keanoppy

Hi all...i'm currently trying to manipulate strings from tokens. may i know how to eliminate a char from a token without splitting it?Below is some code that i tried.How can i eliminate a certain word after the tokens are set? [CODE] package autotextsum; import java.util.*; import java.util.StringTokenizer; public class AutoTextSumm …

Member Avatar for keanoppy
0
249
Member Avatar for sawant_nitesh

Why this code fails.... ? [CODE] String a = "abcd/dgws"; a.replaceAll("/", "\\"); [/CODE] it results in ...... Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(String.java:558) at java.util.regex.Matcher.appendReplacement(Matcher.java:696) at java.util.regex.Matcher.replaceAll(Matcher.java:806) at java.lang.String.replaceAll(String.java:2000)

Member Avatar for sawant_nitesh
0
310
Member Avatar for tedtdu

Assumming that program name is "XML.java", I need to perform the followings for each input file in command line--without running the code for every test file: java Xml < input1.txt java Xml < input2.txt : So My Code IS: [CODE]BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));[/CODE] [CODE]String fileName = bf.readLine();[/CODE] [CODE]File …

Member Avatar for tedtdu
0
130
Member Avatar for Garee

I am trying to assign variables in my array diveScore using a for-each loop. However, I don't understand why it isn't working and every element is 0.0 after the loop has ended. Eclipse is showing no errors so I am sure there is something wrong with my logic. Thanks. [code=java] …

Member Avatar for jon.kiparsky
0
112
Member Avatar for Xufyan

I've a assignment question, A point on two dimensional plane can be represented by two numbers: an x coordinate and y coordinate. Eg (4,5). The sum of two point can be defined as a new point whose x coordinate is the sum of the x coordinates of two points similarly …

Member Avatar for Xufyan
0
120
Member Avatar for mahdi68

Hi i want to write bluetooth base app for send and recive string between two device . i have problem . i send string from device A and device B recive it but when i try to send answer from device B to A i get this notifier : [QUOTE]javax.bluetooth.BluetoothExeption: …

0
97
Member Avatar for warbird43

[B]what will be the query for ms access table to update a specific row? Code below is not making a valid result set resulting in exception? need help[/B]:-/ [CODE] import java.sql.*; class OdbcAccessQuery { public static void main(String [] args) { Connection con = null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = …

Member Avatar for Ezzaral
0
120
Member Avatar for toferdagofer

Im trying to make it so that my menu options that i've highlighted are their own method but i was having issues with returning them so i could use the selection as an int for my switch statement.Any ideas? [CODE]import javax.swing.JOptionPane; public class ConversionProgram { /** * @param args */ …

Member Avatar for toferdagofer
0
137
Member Avatar for warbird43

[B]somebody please tell me why im not getting String(X) value as ID,Name,FName are being printed on console correctly but the name of ID(4) from my DB_table is not going into string(X); [/B] [CODE] package gym.resources.busyicons; import java.sql.*; class OdbcAccessQuery { public static void main(String [] args) { Connection con = …

Member Avatar for warbird43
0
103
Member Avatar for merlin1106

This is the assignment: Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user's selection from a menu of available mortgage loans: - 7 years at 5.35% - …

Member Avatar for jon.kiparsky
0
403
Member Avatar for Nitu Khanna

Dear All, I am new to hibernate. Please help me out in solving the following error: [Fatal Error] :5:2: The markup in the document following the root element must be well-formed. C:\Documents and Settings\Neetu.Khanna\My Documents\NetBeansProjects\HibernateExp\nbproject\build-impl.xml:584: Deployment error: Tomcat configuration file C:\Documents and Settings\Neetu.Khanna\My Documents\NetBeansProjects\HibernateExp\web\META-INF\context.xml seems to be broken. Please make …

Member Avatar for JamesCherrill
0
642
Member Avatar for ahsan1

This is the program in java which is an interface to stanford postagger. I have attached a copy of it. I am using netbeans 6.7.1 . I have placed the model file which is "left3words-wsj-0-18.tagger" in the bin folder of jdk and also placed the stanford-postagger.jar in that folder. I …

0
53
Member Avatar for steveh000

Hi Guys I wonder if you can help me get my head around this. I am trying to search a String for a sub string but there are not gaps in the original string for example [code] String s1 = "www.google.com/search/" String s2 = "google" [/code] when i attempt to …

Member Avatar for steveh000
0
111
Member Avatar for erogol

I want to add the created textfields to an array by default. Is there any configuration for the editor of NetBeans or I need to code it to take all separate components to an array. Thanks :)

0
61
Member Avatar for prem2

Hi , I am having a hashtable which consists of some keys and values.I can able to get the information from the hashtable using iterator or Enumeration. [code] import java.util.*; import java.util.Hashtable.*; import java.util.Iterator.*; import java.util.Enumeration.*; import java.io.*; class ex_hashtable { public static void main(String args[])throws IOException{ Hashtable<Integer,String> hobj=new Hashtable<Integer,String>(); …

Member Avatar for prem2
0
134
Member Avatar for raephel
Member Avatar for boiishuvo

I am a new learner of Java. Thq question is "Write a Java program ShowStars.java so that java ShowStars numA1 numB1 .... display a sequence of stars "*", starting from position numA1 and ending at position numB1. If there are further such integer pairs, say, numA2 and numB2, do the …

Member Avatar for javaAddict
0
182
Member Avatar for Megha SR

guys........ can anybody help me in FUNCTRIONS?? i'm not able to understand it. can u show me examples also???????? pls:icon_confused: :cool: pls reply............. thankyou.........:?:

Member Avatar for JamesCherrill
0
93
Member Avatar for madhub2v

i want to know that.. i hava a small java program i.e to caliculate electricity bill(home or commercial). i have compiled and executed it. so now i want to turn this program to a appilcation like caliculator. How?.

Member Avatar for Stefano Mtangoo
0
149
Member Avatar for hmarie88

I keep getting these errors when I try to run the program Exception in thread "main" java.lang.NumberFormatException: For input string: "GTR" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:449) at java.lang.Integer.parseInt(Integer.java:499) at Inventory6.addProductToInventory2(Inventory6.java:549) at Inventory6.main(Inventory6.java:734) I've spent hours trying to figure out what I'm doing wrong and it's due in a few hours. I …

Member Avatar for hmarie88
0
109

The End.