35,618 Topics
![]() | |
Hi! I'm writing a program thats due tomorrow and I have a problem with one aspect: I can draw the picture I want and everything using paintComponent, but then when the user pulls the edge of the window, the program should resize the whole picture- redraw it i guess... How … | |
I am trying to read some numerical values from a file and getting this error: Input Error: Error in input: Floating point number not found.; Expecting Real number in the range -1.7976931348623157E308 to 1.7976931348623157E308 [code][code=java] import java.io.*; public class TriangleMain { /** * @param args the command line arguments */ … | |
The following code is producing this problem (typed with exact characters printed in command prompt, aside from quotations): "Please input D for a daytime movie or E for an evening movie: This is not a valid choice." The program will not allow me to input anything following the prompt for … | |
I'm having some trouble with my code. I want to calculate the final balances of some movie tickets based on their day or night showing (and depending on if they are children or adults). So at the end of the code, I've been trying to get the solution to a … | |
I need to figure out how to set my overall ticket limit (aticket + cticket) to 100 and if a customer goes over the limit, then they are told that they have ordered too many tickets and that they need to try again and then it loops back through until … | |
What I am trying to do is read from a file to an ArrayList and then display it using a JOptionPane. The only problem is the code i am having trouble with is in an ActionListener and I believe somehow I have created an infinite while loop because when I … | |
![]() | Hello! First time Poster :) I'm trying to create a Java Web Crawler. What I want it to do is pass the crawler a starting site, a max depth/levels of sites to go to (as opposed to number of pages) and save files like images and documents. The problem is, … |
Please give me the problem related to java or C# thanks | |
I have created a servlet in java(jsp), compiled it bt m unable to run it..it is does as :- [url]http://host//Servlet/ServletName[/url] But if m workinh locally on my pc,what host should I b mentioning? | |
ah im in 1st year IT student, my project is about to make a Notepad and it should have an event to perform. example: is when i go to [B]"file"[/B] then click the [B]"save"[/B] and it will perform.. pls give some example of class that use an event.. Im new … | |
my Assignment is this : there is a index.jsp with header [COLOR="Red"]welcome[/COLOR].And a link "[COLOR="Red"]open[/COLOR]".when someone click this "open" this must show [COLOR="Red"]HELLO[/COLOR] in the same index.jsp. And this Hello must be from another jsp file ( simply, i want to embed hello.jsp into index.jsp when "open" is clicked ). … | |
I am creating a simple application using Swings . I am executing search on the database and result i have shown in table. My first query resulted in 8 rows which was shown clearly. Now on same frame i changed the search criteria and clicked search button. Now its resulting … | |
Hi all I am programming a database-related application in Java. I have to facilitate several different types of queries, but I'd like to use the same JTable to display the results of each query (one at a time, of course). The problem is that when I'm using one JTable, I … | |
I was wondering if someone could help me determine what to put in the actual parameters of the driver's class constructor since I am using scanner for the input. Driver receives the radius and color from the outside, it takes it to Circle to calculate circumference and area, then returns … | |
I have the following code which outputs incorrectly. [code] public static void extend(ArrayList priceList, ArrayList quantityList, ArrayList amountList){ for(int i = 0; i < priceList.size(); i++){ amountList.add((Double)priceList.get(i) * (Double)quantityList.get(i)); System.out.println(priceList.get(i) + " * " + quantityList.get(i) + " = " + amountList.get(i) ); } [/code] The output for some of … | |
Can I ask if anyone here has any guides or tutorials on how to write a simple proxy server? Simple in a sense that it can be composed of only two classes; the server and the client. It must also be able to accept requests like GET, HEAD, and POST | |
I wrote this piece of code. It is giving me an error that i cannot correct. This piece is saved the file: CE.java public class CE { private String first; private String second; private String ssn; private float rate; private float sales; public CE(String fName, String lName, String secu, float … | |
In the following codes, I only specified the user to input only 4 numbers in the textfield. I want to output the numbers inputted by the user but I don't know how to do it seeing that the "text" and "value" is different in a formattedtextfield. All I see in … | |
i want to play an audio file in java without opening a player ... like an alarm ... does any1 knows how to do this.. and r there any sample codes available online ... (please provide relevant links only) | |
![]() | I have two problems with the focus on buttons in this project. I've pared the code down to barebones to show the problems; there are only 2 simple classes remaining & still the problems persist. It compiles, runs (java ColorView), and all that's required to see the problems is simply … ![]() |
hey guys im pretty new to java but im very eager to learn and want to make my first game :) I want a simple RPG game, but also want to make a GUI. I am using Netbeans as my IDE, do i need anything else to make a GUI? … | |
Hello, I am working on a project that requires a set of points to be sorted by their angles in relation to the x-axis. The angles, which are in radians, store their angle as a double value. My insertion sort algorithm is failing to properly sort the points based on … | |
[CODE]import javax.swing.JOptionPane; import java.util.Random; public class guess2 { public static void main(String[]args) { int num; int guess; int diff; String input; int Diff; Random randomNumbers=new Random(); guess=randomNumbers.nextInt(100); diff= num - guess; Diff=Math.abs(diff); input=JOptionPane.showInputDialog("Enter your guess."); num=Integer.parseInt(input); for(int i=0; i<5;i++) { while(num<0 || num>100) { input=JOptionPane.showInputDialog("Invalid number!Please re-enter: "); num=Integer.parseInt(input); if(Diff==0) … | |
Can someone help me, I was getting an error message about SQL syntax, now I get no error message, it redirects, but database does not change. I also made sure autocommit was enabled. Any ideas? [code=jsp]<%@page import="java.sql.*,java.util.*" %> <% Connection conn = null; PreparedStatement stmt = null; String userName = … | |
why my executable jar file created in Netbeans cant write/output a .txt file. . .my program must create a text file and write with it, how can it doesn't work when i convert it to .jar but if i run it in netbeans it work fine?.. | |
Hello, I am trying to design a page which has a textarea and a button that says "say something", assume the page is "test.jsp". If a user hit that "say something" button, browser redirects to another page where user can enter anything they want, assume the page is "test1.jsp" . … | |
hey guys. i'm having trouble with looping a program. my assignment is to get the user to input a string and then display it backwards. i've successfully done this, but it's supposed to ask if you want to run the program again, and that's where my program fails. [CODE]public class … | |
When I was using Python I created a program using basic knowledge of object orientation to compare between different cars. now when i switch to java I come up with a plan to compare lines I have created a point class and get the lines as well but now i … | |
When i type in the following link manually in firefox as " file://///172.16.2.1/copyediting/ELS/mallet.pdf", pdf file is loaded successfully in the firefox browser. PDF file is located in remote server which is referred by IP 172.16.2.1. I've assigned the Same link in a String in jsp page and tested it through … | |
Hi.I am trying to slice a byte array such that the output must have the required bytes from given location of the byte array.Also I am looking for appending bytes to a byte array.Please help me.References would be accepted.Thanks. |
The End.