32,204 Topics

Member Avatar for
Member Avatar for Oddone

This is basically to request help with my program, as was already evident. I am a student, and an assignment asks me to "Write a method that computes the spherical distance between two points on the surface of the earth, given their latitudes and longitudes." I have written this so …

Member Avatar for Oddone
0
163
Member Avatar for speedy94519

Hello, I have a question about the code below [CODE] // Checks the vertex a if (this.a != ((Triangle)o).a) { return false; } [/CODE] So In a method called Triangle i declared an instance variable like this: [CODE] private java.awt.Point a [/CODE] What I think this code is doing is …

Member Avatar for jon.kiparsky
0
150
Member Avatar for sainzkr

Im running into a problem in my code and cant figure out how I can get it to restart or exit upon completion. public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Welcome to Morgage Calculator", "McBride Financial INC", JOptionPane.PLAIN_MESSAGE); String princible; princible = JOptionPane.showInputDialog(null, "Step 1: Enter Mortgage Amount" ); String …

Member Avatar for jon.kiparsky
0
91
Member Avatar for mjv89

Hi, Sorry for another thread. I'm trying to do matrix multiplication in Java now. Here's my code (that wont work). Please let me know if you spot anything that I should change... [code] class multiply { public static void main(String[] args) { int[][] a = {{1,2,3}, {1,2,3}, {1,2,3}}; int[][] b …

Member Avatar for jon.kiparsky
0
132
Member Avatar for mjv89

Hi, I'm trying to learn more about matrices in Java. I am trying to read in two integer matrices A and B, then print out the calculation for A + B, but I am getting an ArrayIndexOutOfBoundsException on line 21. Any help would be greatly appreciated. [code] class MatrixAdd { …

Member Avatar for mjv89
0
88
Member Avatar for kimhj91107

I need help with this program I need to be able to type all the names and the grades then the graph of all the student will be shown but i am only able to type one student name and grade and the graph shows but i can still type …

Member Avatar for jon.kiparsky
0
94
Member Avatar for Davitch

I am currently a begining Java student and have some code for someone here to look at. Now according to the NetBeans program I am using to write this code there are no errors, but when I run the code I get "Exception in thread "main" java.util.IllegalFormatConversionException: f != java.lang.Integer" …

Member Avatar for Davitch
0
86
Member Avatar for spitfire5295

ok so my code displays 0 every even and odd number can you explain to me how to fix this. i have a feeling it is the displayArray. This is what dispArray should do create a method called displayArray that takes an array of integers AND an integer as parameters. …

Member Avatar for spitfire5295
0
118
Member Avatar for atticusMom

I broke my foot and missed the first part of class where this was covered now I'm all confused. I have a password class and I must create within this class a static method of isValid that will accept a possible password value and return if it is valid. I …

Member Avatar for jon.kiparsky
0
140
Member Avatar for jsefraijeen

Hello sir's/ma'am ,i'm new to Arrays and i got an assignment to do but i'am having a problem in arrays and how to input a String... here's my code. [CODE]import java.util.Scanner; import java.io.*; class AddressBook { public static void main(String[]args) { Scanner in = new Scanner(System.in); Scanner ch = new …

Member Avatar for Lourdupinto
0
417
Member Avatar for sj5536

hi how i calculate number of space and tab from the string return by readline() method BufferedReader Class

Member Avatar for Lourdupinto
0
111
Member Avatar for tinamary

what is the use of constructors in java when we can intialize objects directly

Member Avatar for peter_budo
0
182
Member Avatar for sirlink99

I am making a game, but my buttons don't seem to be working. When I click in a certain area (where the button is) a screen should pop up. It doesn't. Please help. [code] // The "VirusMania" class. import java.applet.*; import java.awt.*; import javax.swing.Timer; import java.awt.event.*; public class VirusMania extends …

Member Avatar for sirlink99
0
110
Member Avatar for chipsch

I have an assignment where I have been asked to ask the user for input. What I am trying to figure out is if there is anyway to call and use methods of another class whose constructor requires parameters without passing them from the main class that will be calling …

Member Avatar for Akill10
0
215
Member Avatar for Naggelos

Hi, I'm using JavaScript to parse the XML onto HTML. I was wondering if there is a way that I can limit the words output on a certain XML tag. For example, for the JavaScript to only display 50 letters (or characters) of the <content> tag in XML Thank you …

Member Avatar for iceandrews
0
54
Member Avatar for prashanth budur

Hello Sir, Iam working on encryption and decryption, now am able to do encryption(DES) i.e it saving in db successfully(as encrypted) bt am failing to do decryption. wt is my doubt is while encrypting am using some secret key to encode the string(say password), that key is generating at that …

0
51
Member Avatar for anumash

The first program compiles fine and is also logically corrrect but the second program also compiles but is logically incorrect!! Why???? Is there something wrong with the methods in the class???? [CODE]import java.util.*; class CashRegister{ private int dollar=0; private int quarter=0; private int dime=0; private int nickel=0; private double pennies=0.0; …

Member Avatar for anumash
0
325
Member Avatar for snehal jirage
Member Avatar for Levi Morris

Hey everyone! I'm a final year programming student doing a research project on the impact of Java compiler error messages in Natural English, with regards to better diagnosis and rectification for novice Java programmers, who use the command line to compile and execute code. One part of my project wants …

Member Avatar for Levi Morris
0
174
Member Avatar for sj5536

hi, i have to read value from text file. but the problem is that text file is in the following formate vlaue1 valu2 valu3 vlaue4 value no value7 no value no = there is no value between column i have to take those value from text file and put in …

0
59
Member Avatar for Dannyo329

Hi, I'm having a problem with reading from the char , coupon, and it comes up with an error saying [CODE]Exception in thread "main" java.lang.NullPointerException at input.Main.main(Main.java:27)[/CODE] At the line which I read from the char, which is that myScan.findInLine bit, I am working from a beginning java programming book, …

Member Avatar for Dannyo329
0
195
Member Avatar for jamesblunt

Hi! I try the following with a [B]javax.swing.JTable[/B]: - a custom TableModel (extending from DefaultTableModel) that allows adding/deleting rows by activating a checkbox in a [B]javax.swing.JTree[/B] - a [B]javax.swing.table.TableRowSorter[/B] (since JDK 1.6) that allows sorting the rows Initially, there is no checkbox marked within the JTree. So, the table model …

0
89
Member Avatar for iwannalearn

hey i am in a great confusion plz help me out.I have done basics of c++,and now i am in a confusion that whether i should continue c++ or to start with java???? plz suggest me

Member Avatar for Moschops
0
143
Member Avatar for uma.kotha89

Dear Daniweb Team, I face memory leaking problem while sending mail automatically when user advertisement expire date(i.e,26 days) was expire..Mail functionality was working when it expiry days come to 26.But it shows following error. It shows an Error Like:: pergem space out of memory leaking. I request u people past …

Member Avatar for masijade
0
128
Member Avatar for nayak.vikash
Member Avatar for deb081900

Hi I am just trying to do somthing in Java. I wrote a small programm in Java using JDBC connecting with MySql. I am using Netbeans 6.9 Here is my database structure - [B]Field Type Null Default Description[/B] pnr_no int(7) No PNR No. t_no int(4) Yes NULL Train No. t_name …

Member Avatar for masijade
0
92
Member Avatar for pankajagar2002

Hi, i have a desktop application that is developed using swing. We have created jnlp to access it from client side. But when jnlp opens, mouse not work properly. After some time it go on the top left corner. Could you give us some suggestion. Thanks in advance

0
110
Member Avatar for Gsterminator

So my problem is that i'm trying to read a MyString that returns a new Mystring in which every digit -0123456789- has been replaced with a certain char. Ex: Blink182 ====>Blinkxxx [CODE]import java.io.*; import java.util.Scanner; //////////////////////////////////////////////////////////////////////////////// class Hw08 { //------------------------------------------------------------------------------ public static void main (String [] args) throws Exception { …

Member Avatar for Gsterminator
0
155
Member Avatar for Neversleepin

Hi everyone, i would like to extract data from text like the following one: [CODE]........... 2011/01/12 The thread 001 title should clearly describe 2011/01/12 This describe or discussion topic. General 2011/01/12 This desc 002 nor discussion topic. General 2011/01/12 titles is 003 as 'Help Me' or 'Urgent' 2011/01/12 This describe …

Member Avatar for Neversleepin
0
133
Member Avatar for kxpatel29

Hello, everyone. I need help on my JAVA project. I was able to write my code, but I do not get the output that I desire. I also need to validate user input. For example, all dollar amounts are >=0. Down Payment has to be atleast 10% of total cost …

Member Avatar for Akill10
0
230

The End.