36,051 Topics

Member Avatar for
Member Avatar for dinesh07.msc

404 error.requesting the resource while i click submit, i included lib files of struts in web-inf dir in this project. build success, not forwarding as per code in mainpage.java. index page(run): <body> <h1>Hello World!</h1> <a href="mainpage">Main page</a> </body> main page: out.println("<html>"); out.println("<head>"); out.println("<title>Servlet mainpage</title>"); out.println("</head>"); out.println("<body>"); out.println("<form action='strapp' method='post'>"); out.println("<input …

0
248
Member Avatar for redtribal23

Below is my queue code. Whenever I enter nos. 1 to 8, it will print 1-7 then replace 8 with 0. If there are any other mistakes in my code please let me know. import java.util.Arrays; import java.util.Scanner; public class Queue { private int[] elements; //integer values from scanner private …

Member Avatar for Tarek_2
0
358
Member Avatar for NightOwl19

Heya guys, i'm a newbie at java gui and trying to make a calculator using swing. Although i have made the calculator previously but this time i'm trying to add a menu bar also. The problem with the code is whenever i try to add menu bar without making the …

Member Avatar for NightOwl19
0
150
Member Avatar for joshua_8

$('#selectList :selected').text(); //retrieve text from multiselect how do you check in the servlet if the text equals to this do this method else the text is this do other method

0
96
Member Avatar for fzr123

**I want to make a web filter app for java mobile??? ** what I need for making this ??? any one can give me any files of this project as class of web filtering...... In my project::: 1. this app will automatically detect the web filter word as adult content …

Member Avatar for ajmi
0
188
Member Avatar for Kuganithy

I filled the data to each field in the Student Form, Then I click the Add button, Finally display the error message. "Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not supported yet." I created stu databas, student table.

Member Avatar for JamesCherrill
0
62
Member Avatar for Samyx

Hi Everyone, I am playing around with some Java following some tutorial online and ran into a problem that I cant seem to figure out. In the code below, inside of the groupButton method I get the error 'JRadioButton1,JRadioButton2 and JRadioButton3 cannot be resolved to a variable'. Can you please …

Member Avatar for cgeier
0
1K
Member Avatar for moaz.amin.37

i write a program its output is below G:\Java\Multithreading>java NewThread Child Thread Thread[main,5,main] Main Thread 1 Child Thread 1 Main Thread 2 Main Thread 3 Main Thread 4 Main Thread 5 Main Thread Complete Child Thread 2 Child Thread 3 Child Thread 4 Child Thread 5 Child Thread Complete in …

Member Avatar for moaz.amin.37
0
293
Member Avatar for ali11

error: no suitable method found for toArray(int[]) return intList.toArray(new int[intList.size()]); ^ method Collection.<T#1>toArray(T#1[]) is not applicable (inference variable T#1 has incompatible bounds equality constraints: int upper bounds: Object) method List.<T#2>toArray(T#2[]) is not applicable (inference variable T#2 has incompatible bounds equality constraints: int upper bounds: Object) method AbstractCollection.<T#3>toArray(T#3[]) is not applicable …

Member Avatar for jwenting
0
4K
Member Avatar for razamughal67

Hello Everyone i am new in java language. and iwant to hide any <div> tag on my site site example: 'www.mysite.com' and i have a div in my website. like <div id='header'> when we load my site the java script run and check my site url. 'www.mysite.com' if the url …

Member Avatar for razamughal67
0
172
Member Avatar for mwenyenia07

Below is a two dimensional array ineteger variable. int[ ][ ] value={{1, 2, 3, 4 }, {5, 6,7}, {8, 9}, {10}} please write a java code that can print the values and sum the column values as shown below: 1 2 3 4 5 6 7 8 9 10 Sum …

Member Avatar for jwenting
-2
210
Member Avatar for kayleigh0411

I have to create a program that will calculate the the average miles per tank and the cost to fill tank of a car. The inputs are tank capacity, miles per gallon, and price per gallon, the outputs are average miles per tank and cost to fill tank. I have …

Member Avatar for Tarek_2
0
207
Member Avatar for engrjd91

I have the following code: import java.util.Scanner; public class WhileLoop { public static void main(String[] args) { int number; int maxValue = Integer.MAX_VALUE; int minValue = Integer.MIN_VALUE; Scanner input = new Scanner (System.in); System.out.println("Enter the length of numbers"); int loop = input.nextInt(); for(int i=1; i<=loop; i++){ System.out.println("Enter a number: "); …

Member Avatar for oussama_1
0
241
Member Avatar for moaz.amin.37

hello i have a problem with Priority when I set priority of any thread then I get wrong output my code is below class Run implements Runnable{ private String st; public Run(String s){ st=s; } public void run(){ for(int i=1 ; i<=10 ; i++){ System.out.println(st+"="+i); } } } class PriorityCheck{ …

Member Avatar for moaz.amin.37
0
259
Member Avatar for dinesh07.msc

When i click hlink in index.jsp , showing null.. and so the output shd be helloworld. i use netbeans 6.9. initservlet.java: public class initservlet extends HttpServlet implements ServletContextListener { public void contextInitialized(ServletContextEvent sce) { ServletContext con=sce.getServletContext(); try{ System.out.println("Hello world"); con.setAttribute("p",con.getInitParameter("print"));// setting context attribute here... }catch(Exception e) { con.log("Error occured",e);}// throw …

0
101
Member Avatar for SQLpower

Hello, So I basically loaded to 2 keys and I want to verify them after I've signed something with one of them, but I a having difficulties. I am getting verified: false at the end without any error. Can someone please point out the flaw? package fliesigning; import static fliesigning.FlieSigning.verifySig; …

Member Avatar for SQLpower
0
288
Member Avatar for navjeet123

Sir I get the following problem in my code that is-- The method getPart(String) is undefined for the type HttpServletRequest my servlet code is: package Servlet; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; …

0
418
Member Avatar for dinesh07.msc

While compiling the error is build failed; I want to access the listofdvd.txt as getInitparameter using servletcontext and to setAttribute dvdlist in initservlet. Meanwhile also i need to getattribute the dvdlist in listdvdservlet.java; # Somebody help me in this case.. # initservlet.java: public class initservlet implements ServletContextListener { ServletContext sc; …

0
99
Member Avatar for sekwamote

import java.util.Scanner; import com.sun.speech.freetts.VoiceManager; import com.sun.speech.freetts.Voice; public class TextToSpeech { public static void main(String args[]){ Scanner input = new Scanner(System.in); String userInput = input.nextLine(); if(userInput == "hi"){ Voice v; VoiceManager vm=VoiceManager.getInstance(); v=vm.getVoice("kutlo1"); v.allocate(); v.speak("Hey my name is kutlo"); input.close(); }else System.out.println("you suck try again"); } }

Member Avatar for jwenting
-1
97
Member Avatar for Gl753

My code has me stumped, My method is right...I think but the output begs to differ. Basically this code is supposed to convert seconds to minutes but the output is somewhat off..here's what I have don so far. String input = JOptionPane.showInputDialog(null, "Enter a value for seconds (positive whole number): …

Member Avatar for oussama_1
0
294
Member Avatar for ksekwamote

guys please help! im having trouble splitting a word into syllables. what i have so far is splitting a word into different compartment bt cant do syllables, i want the code to to be able slice a part of a word,by looking, vowels INSIDE the word!at the end of each …

Member Avatar for sekwamote
-2
2K
Member Avatar for Wisnu_2

Hello guys, i have a problem, is there someone can help me? this is my logic.. public static void Check_Fund(){ String header = "Text1,Text2,Text3,FUND_UALFND_1,FUND_UALPRC_1,FUND_UALFND_2," +"FUND_UALPRC_2,FUND_UALFND_3,FUND_UALPRC_3,FUND_UALFND_4,FUND_UALPRC_4,FUN D_UALFND_5,FUND_UALPRC_5," +"Text4,Text5,Text6,Text7"; String text = "ABC;CDE;EFG;PRMF;0;PRFF;50;PREF;;PRCF;0;PRMP;50;HIJK;;LMNO;PQRST"; String[] head; String[] value; String showText = ""; head = header.split(","); value = text.split(";"); String regex = "\\d+"; String …

Member Avatar for Wisnu_2
0
256
Member Avatar for Vinolia

hi guys.iv been trying hard to do a code which requires me to separate a word into syllables in java but i dont no hw to do it. e.g the word:someone #in syllable: so/me/on/e

Member Avatar for jwenting
-2
2K
Member Avatar for joshua_8

Hi I could get my session values in my jsp, now I want to compare the session value whether it matches the textbox, if it matches, it will redirect the user to another page else it will remain the same page, I am not sure how to proceed, please help …

Member Avatar for stultuske
0
144
Member Avatar for emmas4impact

Hello guys, I have the project to build an Automative Leads. The process flow for this scoring engine needs to be as: SOAP webservice will advertise a "SCoreLead" function that requires an ADF lead to be passed to it. any idea will be appreciated Thanks

Member Avatar for emmas4impact
0
227
Member Avatar for Toby_1

I am on euler project 4, the largest palendrome product of 2 3digit numbers. Here is the program, however it doesn't print a value. please help. package euler; public class problem004 { String reversed; public static void main(String[] args) { int product =0; String stringproduct; //cycles through all the numbers …

Member Avatar for Toby_1
0
165
Member Avatar for navjeet123

The requested resource is not available. please help me . how to solve this thnx in advance

Member Avatar for JamesCherrill
0
73
Member Avatar for My_1

I got everything until to the point that check if the space is emprty or not. I dont know how to do it. can someone give me an example?

Member Avatar for My_1
0
164
Member Avatar for Ritesh_4

Hello I have a text-editor (CKEditor one) whereby am retrieving all the texts (which are in 3 paragraphs), in a single string variable, using Java codes. However, all the 3 paragraphs being retrieved have leading spaces, and I want to remove them for display purposes. How can I do so, …

Member Avatar for stultuske
0
214
Member Avatar for kayleigh0411

There are no errors or anything in my code, and the program runs and works. However, when I only enter a value in one of the text fields to test the error message, it enters "0" in all of the text fields below it. How can I get it so …

Member Avatar for stultuske
0
281
Member Avatar for Vlad_2

What is wrong with my java code in Eclipse? I have 4 different classes and it won't give an output. the problems are in the scorestest with the print function and in scores with the nodes. Please help. ScoresTest: public class ScoresTest { public static void main(String[] args) { // …

Member Avatar for joseph.henriquez
0
251
Member Avatar for hahahanz

hi im having a hard time fixing and identifying the problem. sorry abstraction really confuses me. the problem is I should write a weather prediction program using the random number generator. three outcomes should be possible: rain sun and cloud. import java.util.Random; public abstract class WeatherPredicMain { public static void …

Member Avatar for stultuske
0
176
Member Avatar for engrjd91

I have a simple class named as Invoice, in which I'm taking four instance variables to intialize PART NO, PART DESCRIPTION, QUANTITY PURCHASED & PRICE PER EACH ITEM. I have made getters and setters for each variable, also a method is created in the same class as InvoiceAmount which Calculates …

Member Avatar for engrjd91
0
223
Member Avatar for Necrozze

So I have writen a program that takes a linkedlist and shuffles it randomly using mergesort algorithm. The problam I'm having now is that the original list loses elements after the shuffle, and after som checking with some outputs it seems that it always one of the extra lists who …

Member Avatar for Necrozze
0
815
Member Avatar for ashokkmr22

Need to set cache in browser using javascrip.If the internet is disconnected the web page is load by the same. Guide Me how will arrive this.

Member Avatar for AleMonteiro
0
72
Member Avatar for Shibbir Khan

I would like to stop and mark as failed too long running junit tests (executed within Maven 3 build). I am aware of three ways of doing it: 1) Using Test annotation with timeout parameter: @Test(timeout=100) public void testWithTimeout() { ... } 2) Using Rule annotation: @Rule public Timeout globalTimeout …

Member Avatar for ~s.o.s~
0
157
Member Avatar for moaz.amin.37

i write a code of multithreading in which arise an race condition code is below class Race1{ public void show(String s){ try{ System.out.print("["+s); Thread.sleep(1000); }catch(InterruptedException e){ e.printStackTrace(); } System.out.println("]"); } } class Checking implements Runnable{ Race1 ob=new Race1(); String s; public Checking(String s){ this.s=s; } public void run(){ synchronized(ob){ ob.show(s); …

Member Avatar for vantrendin
0
247
Member Avatar for Shibbir Khan

So i've got a for loop that's reversing every other word in a string. I can't determine which condition is causing this. I've spent a good amount of time staring at this and the API, to no avail. Anyone have any idea why it's not working? String newMessage; StringBuilder stringBuilder …

Member Avatar for JamesCherrill
0
167
Member Avatar for moaz.amin.37

when we create a thread like this class Run implements Runnable{ public void run(){ //You code } } class Helloworld{ public static void main(String args[]){ Thread t1=new Thread(new Run()); Thread t2=new Thread(new Run()); } } in above code thread t1 and thread t2 is creating in `main()` method its mean …

Member Avatar for JamesCherrill
0
274
Member Avatar for ajharul

Hi all! This is my frist discussion. I'm shearing you a very helpfull website that helping me to learn HTML,CSS,Javascrift online. It's w3schools Wish it will help you.

Member Avatar for shashikumar s g
0
222
Member Avatar for Stefce

Hello i have a little problem over here im trying to make a mouse listener and on mouse click the ball to come to the mouse pointer... i have maked a small "game" which is not bunch of confusing code... i have maked the ball to be controlled by the …

Member Avatar for Stefce
0
2K
Member Avatar for laavanya

What does this mean ? Statement st=con.CreateStatement(); how method of Statement interface is accessed by Connection interface reference con ? please help me to understand the concept...

Member Avatar for JamesCherrill
0
365
Member Avatar for Trevor_4

double hours=0, rate=0; double Federaltaxes, Ficataxes, Statetaxes; double netpay=0, grosspay=0, totaltaxes; if (hours <= 40){ System.out.println("how many hours did you work"); hours= input.nextDouble(); System.out.println("what is the rate you get paid"); rate= input.nextDouble(); grosspay= hours * rate; System.out.println("the gross pay is:" + grosspay); Federaltaxes= grosspay * .20; System.out.println("Federal taxes are:" + …

Member Avatar for oussama_1
0
92
Member Avatar for James_30

Changed properties on the embedded derby db. protocol, driver etc. org.apache.deby.jdbc.ClientDriver ... A connection could not be established

0
75
Member Avatar for Jonathan_7

Hello I am an absolute begginer and am working on a paint calulator program. I am trying to return the price from the paintformula ex: price = paintFormula(wallArea,price,height,length,width); or paintFormula(wallArea,price,height,length,width);. When I call the method I keep getting errors like: PaintCalculator2.java:33: error: variable price might not have been initialized. import …

Member Avatar for JamesCherrill
0
166
Member Avatar for karan parmar
Member Avatar for DawnofanewEra

Hello, I got implementation of Data Encryption Standard implementation in java (internet code) but the only part that I cannot understand is the S-Box which shown below. I know how S-Box works but I don't understand this code especially &0x20 and stuffs like that. The S-Box takes a 6 bit …

Member Avatar for rubberman
0
2K
Member Avatar for Ritesh_4

Hi I have a code in java to generate a sitemap xml, and to get the last modified date using the following line of code: `oPrint.println(" <lastmod>"+ doc.getLastModified().toString()+"</lastmod>");` The output in the browser when calling the xml file is `<lastmod>23/05/2014 16:48:24 ZE4</lastmod>` which is in "dd/mm/yyyy"format. However, from this link, …

Member Avatar for Ritesh_4
0
792
Member Avatar for kayleigh0411

There are no errors when I compile the program, but when I run it and use the "Enter" or "Clear" buttons, they do not work. ----jGRASP exec: java IncomeTax Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at IncomeTax.enterJButtonActionPerformed(IncomeTax.java:182) at IncomeTax$1.actionPerformed(IncomeTax.java:125) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6525) …

Member Avatar for stultuske
0
2K
Member Avatar for DkgMarine

hey guys, so i just started learning java and had some error in my first array code. Error: Could not find or load main class Being. I use eclipse if that helps, because i read that these problems might be that ecplise cannot find the class, so just making sure …

Member Avatar for stultuske
0
171

The End.