32,199 Topics
| |
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 … | |
Hey! Firstly, here's the code: for (Row row : sheetToSearch) { for (Cell cell : row) { if(cell.toString().equals("Oladimeji")){ System.out.println("Found Oladimeji!!"); break; } else { System.out.println("Oladimeji not found...."); } } } What this does is search through the an excel spreadsheet, looking for a name (which happens to be my surname!). … | |
Hey, I am trying to make use of the apache POI in my Java project in Eclipse. I previously tried using jxl but what I wanted to do didn't seem so simple with it. With jxl, all I had to do was import a jar. I don't seem to be … | |
hi everyone, i am doing a pizza ordering Gui. i am stuck on 2 things, i am trying to get the receipt string to store the items that are checked. they are multiplying when they are displaying. the second is displaying the string in the jtext area, any help woud … | |
I want to rotate k top element of array for example: k = 2 array before rotate --> 3 , 4 , 2 array after rotate ---> 3 , 2 , 4 int[] temp = new int[k]; for (int i = 0; i < k; i++) { if(this.stack[i]!= null){ temp[i] … | |
This my code someone say were i missed it OAuthRsaSha1Signer rsaSigner = new OAuthRsaSha1Signer(); com.google.gdata.client.authn.oauth.OAuthParameters params = new com.google.gdata.client.authn.oauth.OAuthParameters(); params.setOAuthConsumerKey(oauthconsumerkey); params.setOAuthNonce(Util.getNonce()); params.setOAuthTimestamp(Util.getTimestamp()); params.setOAuthSignatureMethod("RSA-SHA1"); params.setOAuthType(com.google.gdata.client.authn.oauth.OAuthParameters.OAuthType.TWO_LEGGED_OAUTH); params.addCustomBaseParameter("oauth_version", "1.0"); rsaSigner.setPrivateKey(privKey); String method = "GET"; if (body != null && body.length() > 0) { method = "POST"; MessageDigest digest = MessageDigest.getInstance("SHA-1"); digest.reset(); byte[] hash … | |
Hi we need someone to help us with a project that involves creating a twitter bot that will take lists of common unigrams and bigrams along with a list of rgb codes with colour names and will use these lists to create new colour names and post these on twitter. … | |
Hello Friends. I am working in a Java assignment and I am seriously in need of a help. Since I am new to programming, I need an assist. The program which I have to do has the following specifications: Scanners should be used compalsarily The green grocer has asked you … | |
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); /* … | |
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 … | |
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 … | |
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 … | |
**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 … | |
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, … | |
I'm struggling writing a java program that implement a queue. and another that implement a stack. | |
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++) { … | |
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, … | |
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); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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? … | |
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 … | |
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) … | |
a java code that displays multilevel feedback queue scheduling[](http://www.) | |
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 … | |
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 … | |
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) … | |
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 … |
The End.