36,051 Topics

Member Avatar for
Member Avatar for xc3ss1v3

Good morning all. I've run into a slight stumbling block with some code I'm writing. I'm sure you've all seen the numerous Mortgage Calculator threads so I hope you're not too sick of them yet. Basically, I need my code to first ask the user for a decision, then based …

Member Avatar for xc3ss1v3
0
158
Member Avatar for rameezh88

Hey i am a beginner in programming. My code looks like this: public ChatClient1(String screenName, String hostName) { super("Chat"); String host=(args.length<1)?null:args[0]; ...and it continues. The error I am getting when i compile is: cannot find symbol symbol: variable args and its for both the args in the code above. this.screenName=screenName;

Member Avatar for rameezh88
0
117
Member Avatar for BLUEC0RE

Hey! I started using java this year and I finished a java project but when I try moving it somewhere else in my directory it does not execute anymore. My project directory tree goes like this (I am using eclipse)... (ignore the "-") /Root - /bin -- JavaProgram.class -- JavaProgramMain.class …

Member Avatar for BLUEC0RE
0
229
Member Avatar for java_programmer

I am writing a tiny program to learn Spring framework. My application will just print a message which is binded with the view in the server side. My jsp is as follows : [CODE] <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <html> <body> <p>This is my message : ${message}</p> </body> </html> [/CODE] …

0
87
Member Avatar for MikNoz

I'm writing a code in Java where input is a user generated integer string and I have to reverse the integer and check for boolean true or not. I'm stuck at the math portion because I can't exactly figure out the mathematical process of trying to reverse an integer. [CODE]// …

Member Avatar for NormR1
0
107
Member Avatar for Yutxz

My problem is to design a program that uses a mathematical model for heat loss, or Tnew = Told - m(Told - Tair). It also asks me to repeat the code for 60 minutes, generating a new answer every minute. I have completed the code, however I receive no output. …

Member Avatar for javaAddict
0
1K
Member Avatar for JonGR

[code]import java.util.Scanner ; public class Verk6 { static public void main(String[]args) { Scanner scan=new Scanner(System.in) ; double[] a=new double[1000] ; Stats stats=new stats() ; int i=0 ; while(scan.hasNext()) { a[i]=scan.nextDouble(); stats.add(a[i]); i++ ; } Arrays.sort(a, 0, i) ; if(i%2==0) { int m=i/2 ; System.out.println("Median value:"+(a[m-1]+a[m])/2.0) ; } else { System.out.println("Median …

Member Avatar for Xufyan
0
193
Member Avatar for nix_xin

pls help me . . . give me some hints on how to do this program . . . a program that displays a mirrored-right triangle using asterisk. the program should ask the user to enter the number of rows and displays the mirrored-right triangle. the minimum is 3. there …

Member Avatar for Xufyan
0
175
Member Avatar for Bhargavi V

I am getting the following Errors when I am linking the .pdf document I am using the following piece of code[CODE] String lPathPrefix = "file://muceap10.muc.amadeus.net/User Step Folders/BPS_Files/Outlooksoft CPM/01 - Production Environment/01 - Documentation Library/01 - Documents/Daily_Checks/"; String lPath = (lPathPrefix + doccolvalue).replace(" ", "%20"); URI lURI = new URI(lPath);[/CODE] java.awt.Desktop …

Member Avatar for sandcat
0
1K
Member Avatar for pennylynne

Hi!! I have written three classes (two of which are most relevant) and am required to construct an operating calculator. This is the CalculatorPanel: [CODE]/* * CalculatorPanel.java * * Lab 19, COMP160, 2010 * * An alternative GUI front end for the Calculator class * */ import javax.swing.*; import java.awt.event.*; …

Member Avatar for JamesCherrill
0
524
Member Avatar for kimiko

okay i've been using bluej for learning purposes but i kind of hit a snag would it be possible for someone to code me a main method so that it works as stand alone program please [code] public class Circle { private int diameter; private int xPosition; private int yPosition; …

Member Avatar for masijade
0
211
Member Avatar for Wootens

Hi guys, I'm working on a program which is essentially Rock Paper Scissors Vs. the computer. Anyway I'm having a bit of difficulty with it and could use some assistance. I need to use a class method, so I decided to separate the computer's choice in the class method, I'd …

Member Avatar for Laidler
0
384
Member Avatar for jtylerboy222

I believe all of my logic is sound, but syntax is off a bit... -ask for total numbers -for loop to input total numbers -1)input first number -2)throw exception "must be positive" -3)if negative > back to 1 -4)if no exception > calculate average This is my first program using …

Member Avatar for NormR1
0
2K
Member Avatar for Laidler

Im trying to create a program which acts like a fruit machine at the moment i am writing an action listener to work with the spin JButton. i have a number of IconImages constructed. could i possibly set these images as an array and then use the random int method …

Member Avatar for Laidler
0
825
Member Avatar for Sunshineserene
Member Avatar for Kerrai

Greetings from a new Java coder. I have ran unto a problem that i cant seem too solve on my own. And since next class is on Tuesday i hope you can help me out. When i compile this i get an error on "Line 57 : "Scan cannot be …

Member Avatar for musikluver4
0
227
Member Avatar for pennylynne

Hi, I'm working on a program with GUI and I'm having a fair amount of trouble with the following code. As you can see below, I have an application and a support class. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class StyleOptionsPanel extends JPanel { private JLabel saying; private JCheckBox …

Member Avatar for pennylynne
0
115
Member Avatar for jknapp06

Hello, I'm in a software design class and we are using java; I've taken other programming classes and I'm familiar with a few other languages but that's the problem. I feel like I'm missing the point of java. I don't even know the term for it...but the java style I …

Member Avatar for JamesCherrill
0
139
Member Avatar for dv123

[code]<%@ page import="java.sql.*"%> <html> <body bgcolor="pink"> <% String user=request.getParameter("us"); String pass=request.getParameter("pa"); String a=request.getParameter("na"); String a1=request.getParameter("no"); String a2=request.getParameter("el"); Connection con=null; Statement stmt=null; ResultSet rs=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("Jdbc:Odbc:Data405"); stmt=con.createStatement( ); stmt.executeUpdate("Insert Into stud(username,password,nam,nos,elg) Values('"+user+"','"+pass+"','"+a+"','"+a1+"','"+a2+"')"); out.println("File inserted"); } catch(Exception e) { out.println("error"); } con.close(); %> <a href="http://localhost:8080/maya/login1.jsp">go back</a> </body> </html>[/code] I can …

Member Avatar for masijade
0
191
Member Avatar for Wootens

Hey guys, I'm working on this program. It should roll 2 separate die and repeats until the computer rolls doubles. I'm having some issues with it and could use some help. [CODE]// RollDoubles.java // import java.util.Scanner; public class RollDoubles { // Dice roll repeatedly until computer rolls doubles // print …

Member Avatar for Darryl.Burke
0
125
Member Avatar for croc85

HI guys, I would like to create a Java file based on the information from an XML file. I would like to read the info from an xml and generate a class and it's method. e.g [CODE] <person> <name>croc</name> <surname>crocky</surname> <age>12</age> </person>[/CODE] then it should generate: [CODE] public class Person …

Member Avatar for Darryl.Burke
0
566
Member Avatar for amitbhanot

Hi. I am trying to create a stand alone app but stuck somewhere. When i click on a JCheckBox, it opens up another frame window. in this window if i click cancel then the JCheckBox in the previous frame is not checked. but if i click OK then this JCheckBox …

Member Avatar for amitbhanot
0
136
Member Avatar for aliskov

Hi, I found a very useful app on the web. Downloaded the .class file and was just wondering if it would be possible to somehow put that app on my phone. It's a Nokia E5 and I'm certain it has java. Please advise. Thank you.

Member Avatar for aliskov
0
151
Member Avatar for rizla777

Hey Everybody I'm just confused on something for my tic tac toe game. I have to make one in a java gui and im just confused as to how i should go abouts displaying the buttons on the board. What i'm trying to say is why is it better to …

Member Avatar for NormR1
0
128
Member Avatar for emko

Hello, I have to write a program that prompts the user to enter a phone number expressed in letters and outputs the corresponding phone numbers in digits. The user can use lowercase and uppercase letters, as well as spaces between words. And I am supposed to use the charAt method …

Member Avatar for emko
0
4K
Member Avatar for y2kshane

im developing a language converter so i want to do like this source | target (this is only example) aa | q bb | w cc | e im using netbeans ide i have a one textfield for input strings and textarea(i used textarea becoz i dont know how to …

Member Avatar for NormR1
0
174
Member Avatar for jssutton11

I am trying to write an algorithm that finds the Lagrange polynomial given a set of points, in quadratic time. I don't necessarily want the code to do it, just an explanation on how to write this algorithm in java in quadratic time. I know the equation, its relatively simple, …

Member Avatar for NormR1
0
143
Member Avatar for djdanjo82

Hello Everyone! First of all thanks again for viewing my thread. I was hoping someone could give me some good advice or point me to some code examples of java code calling an Ant JUnit Target if that makes sense. Basically I have a very basic java gui that upon …

Member Avatar for Jolint
0
489
Member Avatar for PDB1982

I can't figure out what the error means that I keep getting on my loop. I have it set to only take 5 arguments, which is my limit, but I can't tell what it's saying: [code] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4 at Duplicates.EnterNumbers(Duplicates.java:20) at Duplicates.main(Duplicates.java:28) [/code] Here's my code: …

Member Avatar for kvass
0
156
Member Avatar for krbenet

trouble putting together program for designing catface that will resize in the frame import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import javax.swing.JPanel; import javax.swing.JComponent; import javax.swing.JFrame; import java.util.Random; import java.awt.geom.Arc2D; import java.awt.BasicStroke; /** * A component that draws a Cat Face. *@Kevin Bennett */ public …

Member Avatar for NormR1
0
986
Member Avatar for supreet1986

Hi friends i need ur help. i am learning asp. but now i am goin to face some java question so plz help me in solving these 4 questions.

Member Avatar for NormR1
-1
76
Member Avatar for njjay65

Hello I am a new java student. I have a lab in which we have to compare strings to see if they are anagrams. When I compile it I'm not getting any errors but its not running as it should or as it was running the other night. I have …

Member Avatar for NormR1
0
192
Member Avatar for keanoppy

Hi all, I'm doing sentence scoring. Let say,i have a paragraph with several sentences.Each sentence has a score(type double). Hi,I'm programming java (this sentence score:1.2) It's nice to code (this sentence score:0.3) Not so nice when having problem (this sentence score:0.8) What kind of structure should i use to ease …

Member Avatar for ~s.o.s~
0
92
Member Avatar for enfamos

I am in my second week of java programing and after reading the chapters I seem to be a bit lost this weeks assingment is [I]• Create a non-GUI-based Java application that calculates the payroll for a department in an organization. The application should display text that requests the user …

Member Avatar for enfamos
0
124
Member Avatar for MeandJava

Hello everybody, This is my first time on this forum. I started this year with a study, where i learn Java. I'm from the Netherlands, so some names in the classes you may not know. I have a problem with printing out a few arrays of P in the class …

Member Avatar for JamesCherrill
0
442
Member Avatar for NewOrder

what is the function that allows to accept typed input usually i right import java.io.*; but eclipse has got its own function . what is it?

Member Avatar for ~s.o.s~
0
81
Member Avatar for juice33

I have been working on this code for a total of 6 days, I have be trying find ways to implement the user to enter an integer 5 times then reverese those number and determine wheter this is a palindrome or not. Also not the my public static boolean isPalindrome …

Member Avatar for JamesCherrill
0
121
Member Avatar for hgbreton

I am currently playing about with lesson 08 here [url]http://insanitydesign.com/wp/projects/nehe-android-ports/[/url] I would like to change the background colour from black to white. In order to do this at the start of onDrawFrame() I have called [code=java] gl.glClearColor(1.0f, 0.0f, 0.0f, 0.0f); [/code] This does indeed set a white background screen, but …

0
77
Member Avatar for madawa123

Hi guys, I hv the two coordinates of the map. Top left : 37 44 55.49S 144 52 30.73E bottom right: 37 47 54.43S 144 57 59.54E my map is a rectangle with 500width 800height. I want to get the mouse pointer in terms of lat long in degrees and …

Member Avatar for peter_budo
0
4K
Member Avatar for sky_B

I have try to run a program of JApplet as JFrame, but it didn't works. Can someone help me?Thanks.[CODE] public class MyApplet extends JApplet{ //have some coding here class display extends JPanel{ //have some coding here } public static void main(String [] arg){ JFrame frame = new JFrame("MyApplet"); MyApplet applet …

Member Avatar for NormR1
0
161
Member Avatar for NewOrder

i have questions abou the algorithm that i have got here: [CODE] public class BTreeEx3 { public static void main(String[] args) { BTree tree=new BTree(); tree.add(5); tree.add(6); tree.add(1); tree.add(19); tree.add(3); tree.add(10); tree.add(2); tree.print(); } } class BTree{ private Node head; // why is the head private? public void add(int info){ …

Member Avatar for JamesCherrill
0
123
Member Avatar for girlinwayside

I am taking an online java programming class this quarter and the book I have just does not do a good job of explaining anything! The more I read it, the more confused I become! Can someone refer me to an article or site that explains creating methods in terms …

Member Avatar for stultuske
0
2K
Member Avatar for khaled_jawaher

I want to use java to access microsoft sql server express remotely.i have allow remote connection in the database that i have.and i allow port 1433 through firewall. the code is: [CODE] import java.sql.*; import java.lang.*; public class Jdbcconn { public static void main(String[] args) { try { //load the …

0
61
Member Avatar for shivaniaroraji

I was reading a program as follows [CODE]import java.util.StringTokenizer; class Tokentester { public static void main(String[] arguments) { StringTokenizer st1,st2; String quote1="Vdef 3 -1/16"; st1=new StringTokenizer(quote1); System.out.println("Token 1: "+st1.nextToken()); System.out.println("Token 2: "+st1.nextToken()); System.out.println("Token 3: "+st1.nextToken()); String quote2="NGNDFBgh 27/32@3/ewtg@tryh@eretgse"; st2=new StringTokenizer(quote2,"@"); System.out.println("Token 1: "+st2.nextToken()); System.out.println("Token 2: "+st2.nextToken()); System.out.println("Token 3: "+st2.nextToken()); } …

Member Avatar for JamesCherrill
0
151
Member Avatar for raincomeagain

I want to generate random numbers, display them with ten in a row, and count how many are 1s, 2s, 3s, 4s, 5s, and 6s with nested if/else statement. [CODE] import java.util.Random; public static void main(String [] args) { Random generator = new Random( ); int value = 0; int …

Member Avatar for Xufyan
0
142
Member Avatar for Xufyan

In my program I've created two methods , one with integr type and other with float (line # 20 and 29) !! [CODE]class Stack{ int StackArrayI[] = new int[2]; //0,1,2,3,4,5,6,7,8,9 float StackArrayF[] = new float[2]; //0,1,2,3,4,5,6,7,8,9 int tos=-1; public void push(int value){ if (tos==1) System.out.print ("Stack already Full..!\n"); else StackArrayI[++tos] …

Member Avatar for Xufyan
0
114
Member Avatar for nix_xin

Simple Reusable Portable (Platform Independent) Distributed Robust Secure High Performance Dynamic Threaded Interpreted aside from those, what else are the fundamental components of java application programs?

0
57
Member Avatar for slixtrix

[CODE]import java.util.Scanner; import java.io.*; public class infixtopostfix { String fname; String output = ""; public infixtopostfix(){ System.out.println("starting infixtopostfix() method..."); getFileName(); readFileContents(); } public int priority(Object x){ if(x.equals('+') || x.equals('-')){ return 1; }else if(x.equals('*') || x.equals('/')){ return 2; }else{ return 0; } } public void getFileName() { Scanner in = new …

Member Avatar for slixtrix
0
147
Member Avatar for jems5

Since starting this course and seeking to join this forum, I have learned a lot and want to thank everyone for their assistance on my own forum questions as well as those I have read during research in this forum. Having said that I have another array question. I now …

Member Avatar for jems5
0
135
Member Avatar for justme_nick

I need to make a program to illustrate the Random Class and loop sentinels. So far, I can ask for the input of the number. After that, there are countless logical issues that are coming up. Can anyone help me sort this out? [CODE]import java.util.Scanner; import java.util.Random; public class HiLo …

Member Avatar for coil
0
108

The End.