36,051 Topics

Member Avatar for
Member Avatar for Covinus

import java.util.*; public class al{ public static void main(String[] args){ List l = new ArrayList(); Object a = "hello"; l.add(a); l.add("asdasd"); l.add("hgdfsdfshjk"); System.out.println(l.isEmpty()+""); System.out.println(l.get(0)); for(int i=0;i<l.size();i++){ String b = (String)l.get(i); System.out.println(b); } } } i still havent figured out how to solve the warning it gives. can someone esplain to …

Member Avatar for masijade
0
74
Member Avatar for deepak_gurav22

Here is the code that I have written please check what is wrong, as I am not able to display Images on canvas. I am trying to create game. package PuyoPuyo; import java.awt.Canvas; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JButton; import javax.swing.JFrame; import …

Member Avatar for deepak_gurav22
0
158
Member Avatar for samaru

Microsoft does it again! After having a court trial with Sun, about WindowsXP's problem with Java, Microsoft has come up with a good idea. Make its own version of Java and screw Sun. http://news.com.com/2100-1001-937053.html?tag=fd_top

Member Avatar for The Dude
0
630
Member Avatar for harbir

Dear All I admit that I am new to this all. I am trying to run a simple login function. I have two jsp files, login.jsp and welcome.jsp and I have one servelet login.java My project name is onjava (I am doing this from an example from the web). My …

Member Avatar for techkar
0
124
Member Avatar for plasticfloor

Hey, I've created a small rich client eclipse application from the wizard. now i changed my mind and i want it to run as a plugin. it should be fairly straight farward but i can't seem to find where on the manifest to make the change. please help

0
71
Member Avatar for peter_budo

Just have small program to practice with Calendar. However I come accross something unusual. Once you set date for 1st April 2007 or 1st June 2008 for example you get wrong number of the week. example bellow show code set to date 1st June 2008 [code] import java.util.*; import java.text.DateFormat; …

Member Avatar for peter_budo
0
108
Member Avatar for itchap

Hey, I came across this question, this is the 1st time I write a XML file, and I have no idea if my work is correct, or if thats how its supposed to be.......please give me your feedback: Consider the following XML file that describes a pizza: An order for …

Member Avatar for jwenting
0
78
Member Avatar for peter_budo

I'm working on calendar application, similar to one provided with instalation of Tomcat. There you have class1 with methods which provide data for class 2. I have no problem to compile class1, but getting errors while compiling class2. This apply also to Tomcat examples if you try to recompile them. …

Member Avatar for peter_budo
0
120
Member Avatar for ronakp25

I have a probelm regarding printing a jsp page. When i print my page from browser, which comes in poppup window. then right sideof page is cutoff. that page contain main table tag which defines the complete layout.all data are td tag. I tried to change width and also margins …

Member Avatar for jwenting
0
62
Member Avatar for Mix

Ok I have a program that accepts input from a file. it reads in inputs and is supposed to close automagically when it sees the number '42'. Only problem, I can read the input just dont know how to look for 42. Here's the code? HELP plz. [code]import java.io.* ; …

Member Avatar for zorr
0
99
Member Avatar for Colin Mac

This is an example from a book to explain using the WhoWins type for three possibilities. But when I go to compile, I get the error, "cannot find symbol - class WhoWins". Any suggestions? Thanks [code]import java.util.Scanner; import static java.lang.System.out; class Scoreboard { public static void main(String args[]) { Scanner …

Member Avatar for Colin Mac
0
105
Member Avatar for shortone

first of all I run on microsoft XP, I have a toshiba satellite laptop 1415-s173. I think i'm running using IE 6 I'm not sure I do'nt know how to find out. I think it's either 6 or 5.5 and AOL version 9.0 This is a fairly new computer, purchased …

Member Avatar for asmqb
0
150
Member Avatar for kimbokasteniv

I've never actually ran a CLI based program outside of bluej. And after exporting one of my programs to a jar, I noticed I was not able to get any results when double clicking the jar. So, I'm guessing CLI based programs are run by a different method, or require …

Member Avatar for Colin Mac
0
115
Member Avatar for bluebird

hello, What problems will I encounter if I use Array although I don' know how many elements need I store? If I set the array size very large than I expected, can problem arises anymore? I tried to use Arraylist. But when there are many attributes, I always declare a …

Member Avatar for aviasoorya
0
141
Member Avatar for bayu_paeh

pealse give me little sample about calling an ejb from a jsp thank's

Member Avatar for jwenting
0
52
Member Avatar for ajrobson

I got this servlet off of coreservlets.com i want to know how i can edit it so that it connects to my database to get catalogItem instead of using static html. /** A catalog that lists the items available in inventory. * * Taken from Core Servlets and JavaServer Pages …

Member Avatar for jwenting
0
87
Member Avatar for John P.

Hello, im trying to compile few .java files but i'm geting error message: GraphicsHandler.java:62: ';' expected for (Player p : server.playerHandler.players) { GraphicsHandler.java:67: illegal start of expression }}} I just don't know what to do... ----------------------There is my GraphicsHandler.java-------------- public class GraphicsHandler { public static int[] GFXspot = new int[5001]; …

Member Avatar for jwenting
0
99
Member Avatar for rpjanaka

hi all, i got this example from a website, but unfortunately i cant understand some cording in that source. the green color lines are the difficult points that i could not understand. also the database name, user name and password has not specified at anywhere in this cord. how can …

Member Avatar for jwenting
0
128
Member Avatar for Cudmore

So I've run into this situation a million times in my "learning career" and I've always found a long way around the issue so as not to risk throwing unnecessary exceptions.. Let's look at a simple example... [CODE=java]boolean IsEnabled (JPanel MyPanel) { return MyPanel.isEnabled(); }[/CODE] Throws java.lang.NullPointerException if null is …

Member Avatar for jwenting
0
363
Member Avatar for Shtock

For about a week now I've been getting the error message: "Generic Host Process for Win32 Services has encountered a problem and needs to close. We are sorry for the inconvenience." It's driving me up a wall. I usually get it upon startup, but it has been known to appear …

Member Avatar for gerbil
0
157
Member Avatar for Colin Mac

Just started reading 'Beginning Programming in Java for Dummies' and when I got to the first example below, I'm getting errors when i try to compile? I have the JDK 5 update 9 and the Jcreator IDE installed. Thanks in advance. [CODE]class MyFirstJavaClass { /** * Method main ** * …

Member Avatar for iamthwee
0
87
Member Avatar for anukool

Hi everyone iam trying to learn awt and applets. The code below has compiled well but when i run it iam getting an Exception in thread main "Java.lang.NoSuchMethodError". Could any1 pls tell me where i have gone wrong. import java.awt.*; import java.applet.*; import java.awt.event.*; public class ButtonTest extends Applet { …

Member Avatar for Dukane
0
80
Member Avatar for caduggins

I am writing a code for class that calculates 3 different mortgage rates with 3 different time periods and then displays the monthly payment. What I am getting for the output is on 2 of the payments is a negative payment amount. I am at a loss to understand why. …

Member Avatar for jwenting
0
103
Member Avatar for Joncamp

Taking a Java test I found a for{} loop which had a : character in it?... like this... for { : } I was supposed to fill in some objects, but I have no idea how a : character does in a for loop? Any comments? JON

Member Avatar for Dani
0
165
Member Avatar for itchap

Hi Everyone, I'am currently working on this question: Write a producer-consumer problem that uses threads and shares a common buffer. However do not use semaphores or any other synchronization primitives to guard the shared data structures. Just let each thread access them when it wants to. Use sleep and wakeup …

Member Avatar for jwenting
0
178
Member Avatar for DaveNY

Hi I wrote code for Java program to simulate the rolling of 2 dice. The application should roll the dice 36,000 times. In a tabular format it should show the frequency of rolling 2,3,4,5,6,7,8,9,10,11,12 and also the percentage. It compiles alright but I am not getting the output. Can someone …

Member Avatar for qkerby
0
171
Member Avatar for LoobyLou

Hi I have created a registration form, where on the first page the user enters a user name and password, then they go to the next page where they enter their name. This then goes to the next page where they enter their address, then there contact details. But I …

Member Avatar for jwenting
0
74
Member Avatar for LoobyLou

Hi Im trying to create a registration form. I have created the form which includes user name and password text fields, by using the record insertion form wizard. Dreamweaver has inserted a hidden field, but how do I change the properties of this to insert the data into a database …

Member Avatar for jwenting
0
52
Member Avatar for binoy.M

Hi all... i am trying to add a vector to the hashtable as a value.This vector contains three fields.But the problem is while adding new vector to the hashtable as value the old vector is also replaced with new one.... So please help to solve this problem..

Member Avatar for jwenting
0
211
Member Avatar for rpjanaka

hi i am tring to use connection pooling in java with postgresql database. in given examples, i cant understand these file names that is given to create InitialContext object, also that file names are different for each and every examples. how can i get those files, and what are those..? …

Member Avatar for jwenting
0
225
Member Avatar for Mike999984

Is it possible? Because I want to convert my Mario by Utter Chaos into Java to put on my website.

Member Avatar for TylerSBreton
0
251
Member Avatar for LoobyLou

Hi Does anyone know how to insert data into a database from a website? I have created a Registration form for users to register to my web site. With this I would like the data they have entered to be stored in a MySQL database. I have created the a …

Member Avatar for jwenting
0
102
Member Avatar for ShipraSingh

I get the following error message when I try to test Apache SOAPServer by pointing my browser to [URL]http://localhost:8080/soap/servlet/rpcrouter[/URL] [B]exception[/B] javax.servlet.ServletException: javax/mail/MessagingException org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) org.apache.jsp.admin.undeploy_jsp._jspService(org.apache.jsp.admin.undeploy_jsp:105) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) [B]root cause[/B] java.lang.NoClassDefFoundError: javax/mail/MessagingException org.apache.jsp.admin.undeploy_jsp._jspService(org.apache.jsp.admin.undeploy_jsp:55) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) I have set my class path's to: ;C:\jakarta-tomcat-4.0.1\common\lib\xerces.jar;C:\soap-2_3\lib\soap.jar;C:\soap-2_3; …

Member Avatar for jwenting
0
176
Member Avatar for fivepointer

How do you distinguish between numbers that are add and even in javascript? i searched a whole jscript book and web for it but couldn't find any info.

Member Avatar for jwenting
0
52
Member Avatar for waqar-khan-777

[B]Description of the Problem [/B] The Raju Corporation maintains a chain of hotels world-wide and wants to introduce a new computer system to capture feedback from hotel guests. Information will be sought on comments made on various aspects of each hotel's operations (such as compliments about service received, and suggestions …

0
68
Member Avatar for Phaelax

[code=java] public static final String SEPARATOR = System.getProperty("file.separator"); String code = "test.foo.bar"; String fix = code.replaceAll("\\.", SEPARATOR); [/code] I'm keep getting a StringIndexOutOfBoundsException. If I replace SEPARATOR with "[URL="http://www.daniweb.com/techtalkforums/"]\\\\[/URL]" then it'll work as I want. Is there a safe way to replace the periods with the file separator associated with …

Member Avatar for DavidRyan
0
98
Member Avatar for itchap

[B]Hey,[/B] [COLOR=black][/COLOR] [B][COLOR=black]does anyone happen to know which method is called by the garbage collector on an object when garbage collection determines that there are no more references to the object? [/COLOR][/B] [COLOR=black][/COLOR] [B][COLOR=#ff99cc][COLOR=black]and does anyone happen to know which class contains the definition of this method?[/COLOR] [/COLOR][/B] [B]Thanks :) …

Member Avatar for itchap
0
115
Member Avatar for caduggins

import java.math.*;//*loan calculator import java.text.*;//*formats numbers public class MultipleMortgageLoans { public static void main(String args[]) // ** added { // declare class variable array double mortgageCalculator1[] = new double[6]; double mortgageCalculator2[] = new double[6]; double mortgageCalculator3[] = new double[6]; double payment = loan/discountfactor; double discountfactor = discountfactor; //construct the array …

Member Avatar for Dukane
0
164
Member Avatar for Phaelax

For awhile now, I've been using Mac to code java. Though my programs compile and run fine, I always get these errors. Using the same project to compile on windows with the same IDE(netbeans), I dont get them. I was hoping someone would be able to shed some light on …

0
80
Member Avatar for stormz

Hi everyone, im doing this question: (1) Find the errors in the applet given below and re-write it after correcting the errors. [CODE] import java.awt.*; import java.applet.*; public class appError extends Applet{ String name; public void paint() { Font font=new Font(“Monospaced”, Font.ITALIC, 36); setFont(font); setBackground(yellow); setColor(red); drawstring(name); }//end of paint() …

Member Avatar for iamthwee
0
67
Member Avatar for rLh

Hi im new in Java. i have this case study and i don't know how im gonna do it. my professor wants me to create a menu or message box that has 3 options ex. [ 1 ] Addition [ 2 ] Subtraction [ 3 ] Exit ____________ *________ this …

Member Avatar for masijade
0
277
Member Avatar for Talon

Alright, some of you have seen me ask this before but here it is again. I am a first year java student and I need an idea for a simple but well-looking semester project. If you could give me some ideas I would be thankful. I'm not asking for you …

Member Avatar for jwenting
0
351
Member Avatar for spacecowboy123

Hi All, I am new to java and am trying to display an image that i have loaded from disk in a GUI I have made by creating a class that extends Frame. I have several buttons and labels in a few different panel. All i want to do is …

0
78
Member Avatar for totengtoh

/*please helpme! how can i get the number of times on how i attemp to get the correct answer! please help me customize my inputbox i am new to this! this is a project of mine please help:mrgreen: :mrgreen: :mrgreen: */ import java.util.*; import javax.swing.JOptionPane; public class Project{ public static …

Member Avatar for Dukane
0
89
Member Avatar for izharg

hi dudes, i need an urgent response for a project at the uni. i'm looking for code which can recognize operating system tasks\actions and output it in text format. i.e when i'm clicking on "Start" button, the code will generate a text string: "Click on Start" cheers mates Izi :rolleyes:

Member Avatar for Phaelax
0
106
Member Avatar for javanewbie

All, I am having a bit of trouble displaying someting using the JOption.Pane format. I know we are not supposed to pose questions here But I am at a loss and simply do not know where to turn. I am writing this code for class. It is a mortgage claculator …

Member Avatar for bjj
0
182
Member Avatar for sam1

Hi, i am trying to write an application that uses validation check for social security number. it should allow 9 charachters. the first two and the last character should be leters and the rest should be digits. i have used for loop but it doesnt work properly. [QUOTE]int noChar = …

Member Avatar for DavidRyan
0
159
Member Avatar for Covinus

[code=java] import java.io.*; class Tokenizer { public static void main( String args[] ) throws Exception { String sample = "myfile.txt"; InputStreamReader in; FileInputStream file = new FileInputStream(sample); in = new InputStreamReader( file); StreamTokenizer parser = new StreamTokenizer( in ); while ( parser.nextToken() != StreamTokenizer.TT_EOF ) { if ( parser.ttype == …

Member Avatar for jwenting
0
163
Member Avatar for Metsfan147

I'm trying to figure out implementing the clone() method of Object. I have a class with a few data memebers that I thought I'd try it out on - a node class for a linked list. So, here's the class: [code] public class HashListNode implements Cloneable { private String data; …

Member Avatar for Metsfan147
0
116
Member Avatar for Declan123

Could someone tell where the COM libraries can be downloaded, or are they only available with the EE Thanks

Member Avatar for manojdesai
0
78

The End.