31,001 Topics

Member Avatar for
Member Avatar for haneenmegren

and i have more than one class this is my java file and im using netbeans import java.applet.*; import java.awt.*; import java.net.*; import java.awt.event.*; import javax.swing.*; public class sb extends JApplet { Thread threadABC; AudioClip gong; /** * Initializes the applet starbucks */ @Override public void init() { resize(920,700); /* …

Member Avatar for haneenmegren
0
229
Member Avatar for Brandon_7

I've been studying computer science and computer programming for years now in high school. I've been accepted to universities that offer two different kinds of degrees. One is Computer Science and one is Software Engineering. I could go either way for which degree I get, I was just wondering if …

Member Avatar for rubberman
0
548
Member Avatar for liphoso

I have a class called Car, 6 other classes (Van,Cab,Truck, Taxi, Sedan and Motorbike) that implement this class. Each of the subclasses has its own mnethods and attributes. How would I go about creating an array of these vehicles with the type of car being randomly selected. that is I …

Member Avatar for liphoso
0
209
Member Avatar for Ant695

The idea is to write a program that asks a user for 10 numbers and then displays how many positive and negative numbers were entered. Not really sure where I'm going wrong but this was an extra assignment to kill time while everyone else catches up. this is what I …

Member Avatar for DaveAmour
0
253
Member Avatar for amc2244

**Here is what I had to do:** In this project each individual will create a data analysis program that will at a minimum, 1) read data in from a text file, 2) sort data in some way, 3) search the data in some way, 4) perform at least three mathematical …

Member Avatar for stultuske
0
200
Member Avatar for divinity02

int randnum; randnum = (int)(Math.random() * 15 + 1); String p1, p2, welcomemsg, rulesofgame; int age, targnum = 0; int r1, r2,r3,r4,r5,r6; int largest, smallest, numtries = 0; char ans, y; int addscores, numoftries, numofrounds = 0, questions = 0, count; String userinput; for(count = 1; count<3; count++){ System.out.println("Welcome Students, …

Member Avatar for rubberman
0
114
Member Avatar for loteni

I'm struggling writing a java program that implement a queue. and another that implement a stack.

Member Avatar for rubberman
0
92
Member Avatar for Colin_3

hi im getting index out of bound error i cannot find exactly were the error is coming from.can anybodyhelp.tnks import java.util.*; class allshortinVector `{` static Vector<String> v2=new Vector(); public static void main(String[] args) { Vector<String> v=new Vector(); v.addElement("test"); v.addElement("hello"); v.addElement("JAVA"); v.addElement("Program"); for(int i=0 ; i < v.size() ; i++) { …

Member Avatar for TekknoDraykko
0
175
Member Avatar for london-G

Hi Guys, I am getting an error: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "jLabel4" With this code: public void insertCustomer() { Properties conProps = new Properties(); conProps.setProperty("user", "user"); conProps.setProperty("password", "pass"); int q = Integer.parseInt(jLabel4.getText()); try { con = DriverManager.getConnection("jdbc:mysql://91.208.99.2:3379/5thfloor_pos", conProps); con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE); } catch (SQLException ex) { Logger.getLogger(AddProduct.class.getName()).log(Level.SEVERE, null, …

Member Avatar for TekknoDraykko
0
344
Member Avatar for london-G

I am trying to retieve the total salaries from a table where the customer name is X. I have the code below however there seems to be an error. public void total(String name){ double totals=0; Properties conProps = new Properties(); conProps.setProperty("user", "user"); conProps.setProperty("password", "pass"); try { con = DriverManager.getConnection("jdbc:mysql://91.208.99.2:3379/link", conProps); …

Member Avatar for london-G
0
195
Member Avatar for Sugmuffen

I'm trying to implement a MiniMax algorithm with alpha/beta pruning. Totally stuck and can't see where I'm wrong. The class MiniMax contains a State and an Action. The method getAction returns an Action (supposedly the best action to take). The Game object has two methods, isTerminal returns true if the …

0
139
Member Avatar for scheppy

Ive made a java program to do automated tasks for a game. It takes screen shots with java.robot every 250 milliseconds. The program is working great, but it will always crash at around the 30min mark Im running this program on my mac, and this is the crash report that …

Member Avatar for scheppy
0
414
Member Avatar for shayan_doust

Hello there. Currently, I am trying to develop a graphical number guessing game in JAVA. This is my first project in java. Here is an insight in the application: When the application is first opened, a random number (1-100) is assigned to a variable. When the user enters their guess …

Member Avatar for TekknoDraykko
0
519
Member Avatar for Niloofar24

Hello. I'm looking for a good tutorial for creating a chat messenger in java. I checked [this link](http://www.javaworld.com/article/2076864/java-concurrency/building-an-internet-chat-system.html?page=1) but it was not good and clear, was poor tutorial without clear explanation and details. Can you help me with another tutorial? Tutorial video or text both are good. (Let me mention …

Member Avatar for JamesCherrill
0
920
Member Avatar for scheppy

Hello all Im trying to make java robot hold down the command key. I have used the following code. robot.keyPress(KeyEvent.VK_META); robot.Delay(5000); robot.keyRelease(KeyEvent.VK_META); This doesant seem to do the trick. Yes I have searched on how to do this but cannot find a working answer. Am I using the wrong keycode? …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Doogledude123

I'm making one of those puzzle games that has the empty tile which you need to slide them around to finish the picture. When I refer to the "Active Tile" I'm referring to the tile that's empty on the board. I'm changing the position of the active tile and the …

Member Avatar for JamesCherrill
0
235
Member Avatar for sahar.97

i got this error in java eclipse Cannot create extension org.eclipse.core.runtime.CoreException: Cannot create extension at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:296) at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:318) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPart(CompatibilityPart.java:266) at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPart(CompatibilityEditor.java:61) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:304) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254) …

Member Avatar for stultuske
0
313
Member Avatar for abdurehim
Member Avatar for Doogledude123

I can swap two tiles, however, when I need to shuffle them, I need each tile to have a unique position. I've tried setting up array's for the x and y position of both the tiles to be swapped checking against the randomly generated number to make sure it's position …

Member Avatar for Doogledude123
0
232
Member Avatar for shahera.arafat

hi :))) I have a pro. here which I can't use the keyListener and the buttons (ActionListener )at the same time !! I can use once a time either the keylistener OR ActionListener ! and in my prog. I should use both of them at the same time ! what …

Member Avatar for JamesCherrill
0
409
Member Avatar for dead19

Write a Java application that computes and prints the grade of a student according to the following algorithm: 1) It should read from the user TMA score and MTA score. 2) If their sum is less than 15, the grade "FC" should be printed and the program will stop. 2b) …

Member Avatar for JamesCherrill
0
103
Member Avatar for collin_ola

Hi! Firstly, here's the code: if(new File("ATM.xls").exists()){ System.out.println("File exists"); } else{ File excel = new File("ATM.xls"); } What I'm trying to do is check whether or not a file exists and then create said file, if it does not exist. This all works fine, but somehow, I'm unable to use …

Member Avatar for collin_ola
0
4K
Member Avatar for Danny_501

Hi, I would like to extract the return (currently false) value from the following XML: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:isPumpOnResponse xmlns:ns="http://webservice.whatever"> <ns:return>false</ns:return> </ns:isPumpOnResponse> </soapenv:Body> </soapenv:Envelope> Is there a way of getting it out of the SOAPMessage object? SOAPMessage soapResponse = soapConnection.call(createSOAPRequest(webMethodName), url); Thanks.

Member Avatar for rubberman
0
218
Member Avatar for jamnoesblunt

Hello I have a text file which contains a dictionery of phrases. I also have another text file. I need to see if any dictionery phrases are inside my larger text file and return the phrases which are in the dictionery. Here is my code so far: private static void …

Member Avatar for stultuske
0
120
Member Avatar for Stan_1

I do not know if this will be of use to anyone but i thought i would just leave it here because i saw a thread where someone asked how to determine if more than one button on a mouse is being pressed and this code below checks to see …

Member Avatar for mKorbel
0
150
Member Avatar for rahulrevolution
Member Avatar for scheppy

Hello All. I have a program that automatically restarts itself atfer a certain amount of time. I am doing this to test some things out. The program is wrapped in a jar. I run the jar from terminal with java -jar ProgramName.jar It will run and will output all the …

Member Avatar for scheppy
0
376
Member Avatar for kavitadc

i am bca student,here is my main html page in that there is dropdownlist,in that thre r lots of root websites...n thre is textbox in that we hv to enter keyword,,,n accordind to that keyword after pressing search button it should be give me all weblinks related to that perticular …

Member Avatar for Slavi
0
117
Member Avatar for Mpradeep

Hi..... this is pradeep I'm intrested to create a better operating system than "Wintel"im also learnt the C,C++ languages.is there any possible to create operating system...........?

Member Avatar for Slavi
0
103
Member Avatar for gahhon

1. What is the format for the first line of a method? 2. How can you view javadoc for a class? For the (1.) I am totally understand by depending on the developer design of the method. But how am i going to explain this since the tutor won't ask …

Member Avatar for stultuske
0
241

The End.