36,051 Topics
![]() | |
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 … | |
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; | |
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 … | |
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] … | |
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]// … | |
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. … | |
[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 … | |
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 … | |
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 … ![]() | |
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.*; … | |
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; … | |
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 … | |
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 … | |
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 … | |
| |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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: … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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){ … | |
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 … | |
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 … | |
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()); } … | |
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 … | |
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] … | |
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? | |
[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 … | |
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 … | |
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 … ![]() |
The End.