36,051 Topics

Member Avatar for
Member Avatar for laidback7

I'm trying to implement a gap sort which is a bubble sort that instead of comparing neighboring elements to sort a list, it compares elements 'i' positions apart. I can get the sort to execute the loop once, but I can't figure out how to make my program continue looping …

Member Avatar for pavigo
1
566
Member Avatar for barthdesv

Hi I wrote a litle code to calculate factorial, but when I compile it, it says " ';' expected " (In the " for ") Here is my code : [CODE] /** * A class to calculate factorial of a number * * @author Barth * @version 10/29/10 */ public …

Member Avatar for barthdesv
0
81
Member Avatar for nethimadhu

HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:430) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:499) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1558) org.apache.jasper.compiler.Parser.parse(Parser.java:130) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:176) org.apache.jasper.compiler.Compiler.compile(Compiler.java:317) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) note …

Member Avatar for peter_budo
0
241
Member Avatar for sreekarjcl

HTTP STATUS 500 PLEASE HELP ME description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.jsp.janki.bsal_005fsearchresult_jsp._jspService(bsal_005fsearchresult_jsp.java:107) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the …

Member Avatar for peter_budo
0
122
Member Avatar for MoZo1

[CODE=JAVA] setFoo(getFoo() + 1); ... private int foo; public synchronized int getFoo() { return foo; } public synchronized void setFoo(int f) { foo = f; } [/CODE] Easy code for a race condition. Easy solution: [CODE=JAVA] synchronize(o){ o.setFoo(o.getFoo() + 1); } ... private int foo; public synchronized int getFoo() { …

Member Avatar for MoZo1
0
200
Member Avatar for dreamslct

I have wrote a simple java programe whose code is as fallow: [code] import javax.swing.JOptionPane; public class HelloWorld { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Welcome"); } } [/code] ------------------------------------------------------ Now I just want that the message "Welcome" to print in differnet size and color. Please help me …

Member Avatar for JamesCherrill
0
202
Member Avatar for NewOrder

i want to make my java project with Jmonkey, is it easier than using eclipse alone?

Member Avatar for NewOrder
0
94
Member Avatar for Pushpasheela

I want to create payslip in java [CODE]public Vector createData() { Vector result = new Vector(); Vector rec = new Vector(); Object[] value = new Object[] {"Employee Name",ename.getSelectedItem().toString()}; rec.add(value); value = new Object[] {"Mary-Kate Olsen", "Ashley Olsen"}; rec.add(value); result.add(rec); rec = new Vector(); value = new Object[] {"Charlie Read", "Craig …

Member Avatar for Taywin
0
132
Member Avatar for aishittero

[B][COLOR="Red"]guys help me if these code is correct [/COLOR][/B] [CODE=java]import javax.swing.*; import java.awt.event.*; public class SampleCalc extends JFrame implements ActionListener{ JTextField txtNum1 = new JTextField(); JTextField txtNum2 = new JTextField(); JButton btnAdd = new JButton("+"); JButton btnSub = new JButton("-"); JButton btnMul = new JButton("*"); JButton btnDiv = new JButton("/"); …

Member Avatar for Taywin
0
84
Member Avatar for roseannes

hey everybody! I want to create a program that counts the number of each word in a sentence given by the user. but I dont know how it is. pls help me...

Member Avatar for roseannes
0
78
Member Avatar for xterradaniel

Just a heads up, I posted this same question on Dream in code over 2 hours ago and nobody has answered. The link is [URL="http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044"]http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044[/URL] I have been trying to figure out how to increment or decrement a value if two keys are pressed at the same time (ctrl+, ctrl-). …

Member Avatar for Taywin
0
161
Member Avatar for LianaN

Hello! I would like to be able to change the sequence of rows in the JTable by clicking on arrows, which will be placed on the right side of the JTable. Please, see an attached file to understand the idea. Well, could someone please give me some advices on how …

Member Avatar for LianaN
0
112
Member Avatar for Oblivious21

Hi guys first off i want to say i really enjoy this forum i just signed up but i have referenced it before. so i have a question i need help with. here is the task at hand [QUOTE]A file called [URL="http://www.cs.oswego.edu/~odendahl/coursework/csc212/201009/assignments/03/tables.txt"]tables.txt[/URL] contains ranges that describe multiplication tables. Each line …

Member Avatar for Oblivious21
0
631
Member Avatar for hari jagadish

I want into values into databas using java code...so send me the sample codes on that senarios using javacode i want to insert values into database ...give an idea to impletement

Member Avatar for SasseMan
0
58
Member Avatar for nikhilrkn

hey U guys.. I need a jsp code which uses AJAX with dropdowns.. Something like COUNTRY NAME in one dropdown and STATE NAME in the other... You may select any STATE at first.. Later when we CHANGE the COUNTRY NAME, states of that particular COUNTRY WILL GET REFRESHED IN THE …

Member Avatar for nikhilrkn
0
101
Member Avatar for Javagirl2010

Hello, I a student and Java is very new to me. I am trying to multiply 2 numbers together to be displayed in a dialog box but I keep getting the error of "cannot find sysmbol" and I do not know what I am missing in my file to clear …

Member Avatar for javaAddict
0
250
Member Avatar for LianaN

Hi! I have a question regarding the SQL Select and "try...catch". The problem is that my SQL Select statement could sometimes return empty sets. For this reason I'm using "try...catch" statement. However, it doesn't work - the error message is generated for the empty set. So, how could I solve …

Member Avatar for LianaN
0
632
Member Avatar for jdiddy

hi i am creating an applet where you click on the button and it adds an image and text to a list, which then will be displayed in a JOptionPane but the Image will not display but the text does. code is as followed; Add the items [code] String additem …

Member Avatar for jdiddy
0
538
Member Avatar for oceanside013

hey guys, my code requires a toString method and an equals method. My question is, did i do them correctly? im a bit confused on this topic, Any help, im greatful for, and the toString and equals methods are at the bottom, Thank you so much. [CODE]import java.util.*; class Scores …

Member Avatar for JamesCherrill
0
166
Member Avatar for priyankayou

Am doing my mini project,i want to insert images in my user login pages,am not doing the project using net beans,,,can u help me by creating a page(need codes) contains a label and inserting image into it... where should i keep the downloaded image so that i get the image …

Member Avatar for masijade
0
77
Member Avatar for flyingcurry

The below is the main method, the wrapper method, and the array search method for a step recursive method used for finding the index position of the searched string. I am encoutering this problem when whatever search I put in, I get the return value of -1. Why and how …

Member Avatar for flyingcurry
0
166
Member Avatar for ceyesuma

Hello. I created a JTabbedPane on a panel and put it on a JInternalFrame of a JDesktop in SetObjects.java. Why can't I get a tabbcount for it after running an AbstractAction? [b]reference JTabbedPane[/b] [code] [/code] [b]reference JTabbedPane[/b] [code] M =(" --> in controlJMenuItems("+e.getActionCommand()+") var: e.getActionCommand() : xxxxxxxx<-- \n"); System.out.println(M); jtp=SetObjects.getCurrentJTabbedPane(); …

Member Avatar for ceyesuma
0
157
Member Avatar for JavaRookie88

Im having trouble creating a Word Decoder, Basically I'm trying to write a method that chooses a random character, and increases in by one place (a to b, b to c) and so on. Any ideas in how to approach that? Thanks, JavaRookie

Member Avatar for Eric Cute
0
178
Member Avatar for frankel81

Hey guys, thanks for looking at this. Honestly i have no clue where to start. i emailed my teacher and havent gotten a response back. Hopefully someone else can shed some light onto my problem. one of my programs i have to make is: Design and implement a Java program …

Member Avatar for Eric Cute
0
105
Member Avatar for kyojin

I need to create a menu, and then depend on the choice, carry out a certain task. But sumhow any number i put in become sumthing else so the switch become deafualt. Can sum1 help? [ICODE] import java.text.DecimalFormat; import java.util.Scanner; public class Lab0602_ATT { public static void main (String args[]) …

Member Avatar for Eric Cute
0
93
Member Avatar for yap_1991

Hi, Im creating a GUI however i'm experiencing some difficulties. I want to have a text field and a button both placed inside a radiobutton. I've tried inputting ONLY the button, but the button is not displayed when i run the codes. Would be good if light could be shed, …

Member Avatar for di2daer
0
181
Member Avatar for hassin

Write a program in java to a class called Employee which is having the following instance variables. name(string type) age(int type) designation(string type) salary(double type) The class Employee must have a parameterized constructor having only name as the argument and initializes the name variable. Proceed with same class.... write a …

Member Avatar for masijade
0
159
Member Avatar for alwinnjavaroor

hi there....recently a friend of mine asked me to convert a c++ coded pgm to java codes.... and there was a macro [#define f(x) x*x*x+6*x* ] i thought of using a function call ..but it would be undesirable for this pgm how do i get a java equivalent for this …

Member Avatar for Ezzaral
0
99
Member Avatar for Katana24

Yo - im making an animation which draws a string to a panel and moves it once the class is loaded. This all works fine but I want to change the colour of the string to white, the background will be black by the way, as well as make it …

Member Avatar for Ezzaral
0
106
Member Avatar for hatux

Can somebody enlighten me why do i get an exception ? code is over here : [CODE] import java.io.InputStreamReader; import java.util.*; public class ObtainKey { public static void KeyAnalyzer(String input) { int idx = 0; int tokenCount; String inputArr[] = null; StringTokenizer st = new StringTokenizer(input); tokenCount = st.countTokens(); for …

Member Avatar for hatux
0
133
Member Avatar for ponens

Hi I'm new to Java, I'm trying to convert standard time to Unix time so I can use that data in Max/MSP (to modulate a tone) eventually I will allow this program to take a text file of ordinary times and write to a text file the converted Unix times …

Member Avatar for di2daer
0
130
Member Avatar for Spiderpig085

hi Guys, Just started java and so far not too bad but i tried to sort out packages today and got this error. Stuck on it for hours. I'm not sure if im importing or setting up the pacakages properly but that where I'm hoping you can help... Im dealing …

Member Avatar for Spiderpig085
0
209
Member Avatar for Sunshineserene

Hi. I have a 2D array in a particular class file. Now, I want to equate a 2D array from another class to it. May I know how to do it? So far, this is what I've done: Example: [CODE]private double[][] residuescores = MatchApplet.mydouble;[/CODE] residuescores is from a class itself, …

Member Avatar for JamesCherrill
0
160
Member Avatar for wilsonz91

Hi, I read a few post on passing arrays from one class to another but i can't understand. I tried doing it and i'm stuck with it, would really appreaciate it if you can help correct the following code: [CODE] //This is my super class public class Transport { protected …

Member Avatar for JamesCherrill
0
6K
Member Avatar for ryan400

Here is my code, for some reason it goes to an infinite loop when i try and adjust the highest and lowest values for the Math.Random() method. The code works fine if i do not try to change those values based on if the guess was higher or lower than …

Member Avatar for ryan400
0
1K
Member Avatar for mallak alrooh

Hello":) I have code and I wont your help in telling its right or wrong and what missing.... This is the question :: If the user chooses 1, then the program asks the user: “Please enter a new dictionary file name”. The program creates a new file with this file …

Member Avatar for JamesCherrill
0
142
Member Avatar for wolfcode

Hi, I have to write a simple Java code real quick and was wondering how to write the following macro in Java: [CODE]#define BUF 256[/CODE]

Member Avatar for alwinnjavaroor
0
391
Member Avatar for Dean_Grobler

Hi there, A thread was started earlier about splitting up a String using the split() method of the string class. Reading that did help me quite a lot in solving a problem of mine that is VERY similiar. Say I have this in a txt file: "Dean Grobler 0794400541 NA …

Member Avatar for Dean_Grobler
0
179
Member Avatar for youvrajsingh

i have a problem hoping if any one can help me. i have to do a project on data clustering with graph theory. the tool must cluster 4 disease avium, leprae, tuberculosis,and bovis. i want to have a sample java code of the mst clustering algorithm to cluster these files. …

0
47
Member Avatar for CompSci_Guy

Here is my assignment: [url]https://docs.google.com/document/edit?id=1lf2t8LOqKmXK8tu8lW7ghDOd1IJw9BXBRi_PDXFtPQo&authkey=CLnyu7UE&hl=en#[/url] Here are the other classes I am using: [url]https://docs.google.com/leaf?id=0B_UHOsQPEyMBNDBhMWExNTgtMTJmNy00MTQxLWI1ZGItMDZiZjM3YTZiZjRi&authkey=CP2ujcoM&hl=en[/url] I am receiving a NullPointer on line 53: regularNumbers.enqueue(i); But, I am not sure why. Additionally, I need to display my results 12 primes per line, and a space between each. Suggestions? Thanks all for taking …

Member Avatar for haranaboy
0
160
Member Avatar for kezkez

what is the best way to display an arraylist? i am currently trying to display it in a textarea but not sure what method to use... [CODE] class Action2 implements ActionListener { public void actionPerformed (ActionEvent e) { String name = field2.getText(); String homeworks = field3.getText(); String exams = field4.getText(); …

Member Avatar for JamesCherrill
0
191
Member Avatar for ADIKTED

how can i create a application that will compute fot the net income of a particular employee here is a sample output: Name:Vernie G. Lopez Position:Manager Rate:500 No. of Hours Worked:40 Gross=20000.00 Deductions: Bonus=1000.00 SSS=2000.00 Medicare=100.00 Tax=3000.00 Net Income==15900.00 Total Deduction=5100.00 .you have to accept name,position,and number of hours worked …

Member Avatar for Eric Cute
0
93
Member Avatar for StaticX

Hello DaniWeb, Basically like the title suggests I am having trouble generating a random element from my array, and storing it in another array. I am quite new to Java, and the api is a little confusing but from what I can see there is no method for this. Searching …

Member Avatar for Eric Cute
0
182
Member Avatar for suhas.sonavane
Member Avatar for andrew37

I have a big problem using the default SQLite database via JDBC driver.I would like to use ORMLite with this.Let me expose my code: [CODE=java]String databaseUrl = "jdbc:sqlite:/data/data/my.package.name/db.sqlite"; Class.forName("SQLite.JDBCDriver"); DriverManager.getConnection(databaseUrl); dataSource = DatabaseTypeUtils.createSimpleDataSource(databaseUrl); databaseType = DatabaseTypeUtils.createDatabaseType(dataSource); databaseType.loadDriver(); UpDao = new UserProfileJdbcDao(databaseType); UpDao.setDataSource(dataSource); UpDao.initialize();[/CODE] I downloaded the ormlite2.8.jar (src) and modified …

Member Avatar for graywatson
0
135
Member Avatar for lilsmurf

I am working on this program and can't get my InvalidTestScore exception to work. Please help! [CODE] public class Grades extends Exception { // Begin public class Grades private double[] testScores; /** Constructor @param scoreArray An array of test scores */ public Grades(double[] scoreArray) // Assign the array argument to …

Member Avatar for BestJewSinceJC
0
200
Member Avatar for Maxprotect

Hey guys. Before I describe my problem, I'd just like to say that I'm completely new to programming, and I'm currently in the first year of my program. I have an assignment to create a "Lottery winning program". The program generates a random seven digit number, and matches it to …

Member Avatar for Maxprotect
0
2K
Member Avatar for matt4682

What I am trying to do is test the values of two variables, and if one is lower than the other then it will display an error message. When the user clicks okay it should return from the error pop-up back to the previous form... When I enter System.exit(0); or …

Member Avatar for matt4682
0
132
Member Avatar for valiandra

Actually I'm new in java, only 2 year, but force to develop advance application for my final year degree project. I'm going to developt image sketching and sketched recognition for police force. My question are: 1. What technique that i could use to to developt to combine several image in …

0
63
Member Avatar for eman 22

as I read in javadoc resultset represents a table which contain database therefore I want to know if there are a general way to iterate this result set and return data of it. on other side the interface result set contain method getString(int coloumindex), how can I implement this method?

Member Avatar for Ezzaral
0
95

The End.