32,204 Topics

Member Avatar for
Member Avatar for Buffalo101

I'm trying to read one line at a time from a .txt using FileInputStream. [code=Java] FileInputStream in = null; // Open an input stream in = new FileInputStream("out.txt"); int c; while ( (c = in.read() )!= -1 ) textArea2.append(new DataInputStream(in).readLine() ); in.close(); [/code] For this out.txt: [code=java] abc abc lalala …

Member Avatar for Buffalo101
0
83
Member Avatar for xterradaniel

I am having trouble coming up with formula to print a triangle of numbers in a panel. I can print them to a specified number, of my choosing, but I can't seem to come up with a formula to print them out according to the size of the frame and …

Member Avatar for NormR1
0
206
Member Avatar for red999

Are there any Java documentation similar to the one at [url]http://www.cplusplus.com/?[/url] I have checked the official Java documentation at the Sun website, but it does not show as much information as the one that I use for C++. For one thing, there are no example codes =(

Member Avatar for red999
0
64
Member Avatar for BboyRodimus

So the prompt is here: Assignment #2 will be the construction of a program that reads in an unspecified number of integers from standard input, performs some calculations on the inputted numbers, and outputs the results of those calculations to standard output. The numbers could be delimited by any kind …

Member Avatar for NormR1
0
1K
Member Avatar for Xufyan

I've create a program for the array of objects, here is the code..! [CODE]import java.io.*; class Student{ int rollno; String name; public void setValues (int rollno, String name){ this.rollno = rollno; this.name = name; } public Student getValues(){ Student s = new Student(); s.rollno=this.rollno; s.name=this.name; return s; } } class …

Member Avatar for NormR1
0
229
Member Avatar for talha06

Hello to everyone, I'm trying to setup a Spring MVC project. I posted my configuration files below. I'll be really glad if someone helps me. Thanks in advance, With regards, Talha. [B]web.xml[/B] [CODE]<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>local</display-name> <context-param> <param-name>webAppRootKey</param-name> <param-value>webapp.root</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> …

0
137
Member Avatar for khurram.1987

when we call servlet from a JSP page .. explorer/program moves to servlet page .... Such in my scenareo i have JSP form that on submiting call servlet to retrieve data from XML .. But problem is that . i like that on submitin form servlet runs in background without …

0
82
Member Avatar for coolhunk

Hi, I am trying to develop a chess game using textual interface. I am using console read to capture moves and update the board accordingly. I am unable to remove Jlabel from the JPanel, i have called sthng lyk panel.remoove(label).......Can any one help me to sort it out plz or …

Member Avatar for coolhunk
0
115
Member Avatar for Buffalo101

Hello, I have a jTextArea I want to use as an accounts panel by an administrator. The admin can append user + " " + password + " \n" to the jTextArea (one line per user + password). When someone tries to log in, the idea is to iterate through …

Member Avatar for Buffalo101
0
183
Member Avatar for daudiam

I downloaded data from google.com/favicon.ico and saved it in a file "icon.png" using the following: [CODE]URL url=new URL("http://www.google.com/favicon.ico"); InputStream ss=url.openStream(); byte bytes[]=new byte[100000]; int offset = 0; int numRead = 0; while (offset < bytes.length && (numRead=ss.read(bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } FileOutputStream out=new FileOutputStream("icon.png"); out.write(bytes);[/CODE] …

Member Avatar for daudiam
0
197
Member Avatar for nix_xin

Create a program that will accept 20 numbers and arrange them in ascending order. The program should determine the distinct numbers and the number of occurrences for each number (or the frequency). Display the supplied values, the distinct numbers and the frequency of each distinct numbers. Your program should use …

Member Avatar for Xufyan
0
168
Member Avatar for nobodycool

Hey folks, plugging away at a new program for class and I have run into a little snag, or rather a fairly major one for my pea sized brain. We are working on constructing a sorted linked listed that will store author names as well as a sorted book list …

Member Avatar for ~s.o.s~
0
1K
Member Avatar for simransuri

[code]import java.util.*; public class Account { int choice,initbal,amt,total,withdraw; int ch; void Initbal() { Scanner sc=new Scanner(System.in); System.out.println("Enter Initial Balance (>200) : "); initbal=Integer.parseInt(sc.nextLine()); while(initbal<200) { System.out.println("LOW BALANCE!!!Balance should be greater than Rs.200"); System.out.println("Enter again : "); initbal=Integer.parseInt(sc.nextLine()); } } void Detail() { Scanner sc=new Scanner(System.in); System.out.println("***************MENU***************"); System.out.println("1. Deposit"); System.out.println("2. Withdrawl"); …

Member Avatar for JamesCherrill
0
162
Member Avatar for Nidhi S.

i want to retrieve images from access database and display in grid layout. i have displayed 1 image successfully but how can i do this for all images together.i have stored images as BLOB

Member Avatar for Nidhi S.
0
96
Member Avatar for rowley4

This code generates all permutations of the numbers 0, 1, 2,...., n-1. I am trying to get it to use recursion to do this. I am not compiling. I do not show errors, but I am not getting it to work. Can anyone see where I am going wrong? [CODE]import …

Member Avatar for JamesCherrill
0
97
Member Avatar for Protoroll

I am writing a toString method for my Nursery class but am having trouble getting everything working properly. I have to go through the ArrayList and call the toString method for each individual tree and then the sum for all of the trees prices. Here is what I got so …

Member Avatar for NormR1
0
88
Member Avatar for Qabane

Hey Guys I don't get what I need to add Im fairly new in Java. this is my code but it gives me these below the line errors below [code]import javax.swing.*; public class Movies { private String name; private double price; private int year; public Movies { name=""; price=0.0; year=0; …

Member Avatar for Akill10
0
175
Member Avatar for royalx

Hi guys, I'm kind of stuck on a problem I was assigned. Pretty much we're trying to reverse words in a sentence. As in, input = Hi I am new to Java to: Java to new am I Hi I've tried this [CODE]String[]Tyler = new String[Sentence.length()]; Tyler[0] = Sentence; for(int …

Member Avatar for Katana24
0
103
Member Avatar for 47pirates

In my Project SchoolManagementSystem there i've tuition fee record in database. So what i'm trying to do is increase the student due balance automatically after 1 month time. How can i do this? Eg: For now the due balance is 1000 and the monthly cost is 800 so after 1 …

Member Avatar for Akill10
0
59
Member Avatar for Protoroll

I have two constructors that are pretty much exactly the same except that one also takes in a boolean value. I want the constructor with four parameters to the call the other one in order to get the the first three. Here is what I have so far. [CODE] public …

Member Avatar for ~s.o.s~
0
104
Member Avatar for rob3097

I figure my formulas are wrong and need tweaking. Can someone help[CODE]package mortgage_calculator; /* Write the program in Java (without a graphical user interface) using a loan amount of $200,000 with an interest rate of 5.75% and a 30 year term. Display the mortgage payment amount and then list the …

Member Avatar for kramerd
0
156
Member Avatar for ceyesuma

I have a java app that used to use a property and I am not sure with the changes I've made to the class path how to find the driver. I thought I was using the exact same installation but I can't find the driver. Can someone please tell my …

Member Avatar for ~s.o.s~
0
493
Member Avatar for NewOrder

[CODE]import java.io.*; public class EnumEx3 { /** * @param args */ public static void main(String[] args) { Fishs fishs=Fishs.AMNON; System.out.println(fishs.getX()); } } enum Fishs { BURI(20), AMNON(50); private int x; private Fishs(int x) { this.x=x; } public int getX() { return x; } } [/CODE] i have that code and …

Member Avatar for ~s.o.s~
0
115
Member Avatar for fullofdoubts

how do i use the same frame object for multiple classes...without overwriting the data..like..i am using a frame and i am using the same object on which i can draw a cirle..and then when i call another class to draw a rectangle..both circle and rectangle r being drawn...this is becuz …

0
48
Member Avatar for slvrmoon32

I need to create a Car class that has the following fields: brand, model, and speed. Each of the fields should have accessor and a mutator methods. In addition the class should have methods that allows the user of the Car class to accelerate and to brake. Accelerating or braking …

Member Avatar for Beauty1304
0
220
Member Avatar for tushartyagi

For my final year project, I plan to write a cloud server using Python. The client will be written by the other team member in Java. The first and foremost problem I have is make the necessary communication between the server and clients. For server to client talk, I thought …

0
59
Member Avatar for dhondu
Member Avatar for peter_budo
0
26
Member Avatar for DoEds

Why am i getting this error? Can someone help me? You can compile it. I'll post all the necessary codes. Because i dont have enough time. Please this is really urgent. *argg my head hurts*** I put in an archive. [CODE]http://h1.ripway.com/Caterwauler/findTheCheese.rar[/CODE]

Member Avatar for JamesCherrill
0
123
Member Avatar for pavan146
Member Avatar for impaler_prince

We are writing a program in JAVA that thru a series of questions helps the user build a computer. This is being done with Radio buttons. We are wanting to know if it is possible to store the selections as objects in the database. So that is the user wants …

Member Avatar for ~s.o.s~
0
110

The End.