32,204 Topics
| |
I'm having a problem reading lines from a text file. The reading in itself works fine, but when the application has read 545 lines of text (545 .readLine()'s) I get a read error exception, for no reason at all as far as I can see. The code for the reading … | |
The code below captures the screen and saves it. Depending on your need, you can modify it to do just what you want [code] import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { public static void main(String args[]) throws AWTException, IOException { … | |
Hie guys, Iam developing a java web application which uses mysql as its database engine. Now I would like to use the hibernate and spring frameworks together. The problem I nam facing is in configuring the various beans and establishing a clear relationship btwn the two frame works. If any … | |
Hello! I'm writing a fractal generation application. I have the fractal part down, but I can't seem to get the coloring right. What I want to do is, as the number gets closer to infinity, the pixel it relates to's color should get darker (Black relating to infinity, The other … | |
In my application an error massage comes when the required data fields are not filled. I did it as, [CODE] if(component.getSelectedItem().equals("")|description.getText().toString().equals("")){ JOptionPane.showMessageDialog(null,"Please insert required details \n ","Error",JOptionPane.ERROR_MESSAGE); } [/CODE] the problem: When I click "OK" when this massage pops up, it closes the entire window. How can I avoid it. … | |
I would like to know if people would be interested in participating building similar starting thread like we have in Java section [URL="http://www.daniweb.com/forums/thread99132.html"]Starting "Java" [Java tutorials / resources / faq][/URL], but targeting Java web development. This thread would hold resources (where to get the things, configurations, basic usage and any … | |
Hey guys, I have started java for a uni class. I am now using object oriented programming. I have taken vb so i know what functions/methods are. however i am having a hard time coding some programs for an assignment. I will try to make this thread as descriptive as … | |
Ok i need some help with this JSP page that has some java in it. My assignment is to create a fictional webpage that requires a login or registration and that checks with the database to make sure that it will verify that no user with the proposed user id … | |
Hello. Is there a way to import data (numbers) in to a Java program which will do analysis on the data? Thanks! Evelina | |
First of all I am a student, I'm in a data structures class. Well I'm having trouble coming up with a getNext method to be used in a linked list class. I am trying to write a getNext method that I can to find out if the list contains a … | |
PROBLEM ANALYSIS 1. To calculate how many liters per vehicle fueled and convert it to price. 2. To calculate the sales of the fuel from beginning to ending of one shift. 3. To calculate sales inventory. 4. All the consumer purchase diesel and unleaded must be recorded and save for … | |
First my skill levels: I was over the moon when a friend donated his Trash80 to me, complete with manuals, oh so many years ago.. I got a glimpse into the PC world and later embraced DOS programming..:) As windows came into the picture I left behind my 'boyhood' knowledge … | |
As discussed on this forum, I'm not looking for a quick answer, just an explanation on why what I have written is not working and a point in the right direction that will make this program work. Problem: Purpose of this program is to create a GUI that presents to … | |
Hi there, please can some help with this very simple regex. I am coming from c# and trying to get up to speed quickly, so have been trying to create samples for my refrence, however can not get this to work [code] String aString = "0123"; Pattern intPattern = Pattern.compile("^[0-9]{3}"); … | |
Write a class called Person.java that has instance variables matric number, name, date of birth, and gender. Use appropriate data types for these instance variables. Include constructor and set and get methods for all instance variables. [CODE]public class Q1L6{ class Person { String name; int DOB; int MatricNum; char gender; … | |
[code] import java.util.Scanner; public class LazyDays { public static void main (String[] args) { Scanner scan = new Scanner(); int temp; System.out.println ("What is the current temperature?"); temp = scan.nextInt(); if (temp < 20) { if (temp > 95) { System.out.println("Go visit our shops!"); } } if (temp >= 80) … | |
As part of an assignment I have been asked to create a SortedLinkedList class. We have been told that we must use the java.util.LinkedList<E> in order to dervie this class. I understand that I must in some way overwrite the .add(Object) method. I realise that I must in some way … | |
i want to remove 0 from an integer array.like if i have an array having element 2 2 1 1 1 0 1 1 2 1 0 1 ,i want this as 2 2 1 1 1 1 1 2 1 1,plz help me | |
Hello, I would like to be able to add 'n' columns programmatically and SET THEIR TITLE as I add them. I have 2 questions: 1. How can I change the title? (not by seting a model to my table but just 'changing a property' - if possible)? 2. Is there … | |
Hi all, I'm just starting java and had to create a method to return the amount of text messages needed for a message x characters long. I'm having trouble compiling and not sure exactly why [CODE] public void msgsReqd(int msgLength) { int numMsgs, smsLength = 160; msgLength / smsLength = … | |
[CODE] import java.awt.*; import java.applet.*; import java.util.*; public class Tower extends Applet { TowerPanel panel; TowerControl control; public void init() { resize(500,450); setLayout(new BorderLayout()); panel = new TowerPanel(); add("Center", panel); add("South", control = new TowerControl(panel)); } public void start() { panel.start(); } public void stop() { panel.stop(); } public boolean … | |
import java.util.Scanner; public class CalculatingSales { private static boolean Double; public static void main(String[] args) { Scanner input = new Scanner ( System.in ); int ProductNumber; double RetailPrice; double total = 0; int Product1Count = 0; int Product2Count = 0; int Product3Count = 0; int Product4Count = 0; int Product5Count … | |
just trying to create a person(or two) using name, age and nationality but its giving me illegal start of expression error // **************************************************************** // Person.java // // Person class with two constructors // *************************************************************** public class Person { private String name; private int age; private String nationality; // ------------------------------------------------------------ // … | |
hello everyone how can i mask a date using [mm/dd/yyyy] and [mm/dd/yy] format in textbox in java?.. and how can i also mask the amount of money using[###,###,###.##] this format?.. thanks! | |
i want to program the parallel port pins to control the electronic / electrical devices. the pins 2-9 i know can be programmed. | |
Hey Guys, I want to convert a character to it's bit representation. For eg: If i have the char 'J' then it's bit representation is '01001010'. Pleae tell how?? | |
[CODE]import javax.swing.JOptionPane; public class PossitiveNegative{ public static void main(String[]args){ int N1, N2, product, PoNoN1, PoNoN2; String N1Str, N2Str, productStr, OutputPoNoN; N1Str=JOptionPane.showInputDialog("Enter a number :"); N1=Integer.parseInt(N1Str); N2Str=JOptionPane.showInputDialog("Enter another number :"); N2=Integer.parseInt(N2Str); product=N1*N2; if (N1>0) PoNoN1=N1+"(POSITIVE)"; else if (N1<0) PoNoN1=N1+"(NEGATIVE)"; else PoNoN1="(NEUTRAL)"; if (N2>0) PoNoN2=N2+"(POSITIVE)"; else if (N2<0) PoNoN2=N2+"(NEGATIVE)"; else PoNoN2="(NEUTRAL)"; if … | |
Hey guys, I have one stupid problem with the return value of one function... this is my code: [CODE=Java] private boolean check(String mail, int N){ // mail = The mail // N = The sum of the characters before the @ and including it him if(mail.substring(N) == "hotmail.com" || mail.substring(N) … | |
so i just started a computer programming course I am in first year and I am learning JAVA. so far its been pretty straight forward and I am enjoying it. Our project at the moment is to take a Birdspecies Class, a Person Class and a Sighting class( they are … | |
I am suppose to move the code from the 1st program that actually plays the game into a new method. I am really new at this and have no idea... import java.util.Scanner; public class GuessingGame { public static void main(String [] args) { Scanner scan= new Scanner(System.in); int n; //a … |
The End.