32,204 Topics

Member Avatar for
Member Avatar for Nuruhee

import java.util.*; import Jama.Matrix; import java.util.*; import Jama.Matrix; public class Suceses { public static void main(String[] args) { System.out.println("회전할 각도를 입력하시오 :"); Scanner a = new Scanner(System.in); int kakdo = a.nextInt(); System.out.println(a); double rad = (kakdo*Math.PI)/180; int x= 50; int y= 30; Matrix A = new Matrix(new double[][] { {Math.cos(rad),Math.sin(rad)}, …

Member Avatar for Markland
0
385
Member Avatar for moe11223

I am new to OOP, i am not sure if this is the correct approach or not. Need some insight. Assignment 3 Write a class named CreditCard that has (at least) the following member variables: name. A String that holds the card holder’s name. cardNumber. A field that holds the …

Member Avatar for stultuske
0
4K
Member Avatar for Wing_1

Implementation of ADT Tree (array) to perform the following operations on an ordered general tree a. create a tree (which is initially empty) ... max of 2 levels only b. leftmost child (n, T) - returns the leftmost node in the tree T c. right_sibling(n,T) - returns the right sibling …

Member Avatar for rubberman
0
113
Member Avatar for AndroidUser

When launching exe file, I am getting the following error, 'The registry refers to a nonexistent Java Runtime Environment installation or the runtime is corrupted. The system cannot find the path specified'. No issues with Environment settings. Can you please help on this. This is really very urgent issue. Kindly …

Member Avatar for AndroidUser
0
1K
Member Avatar for kxjakkk

I'm trying to make a program that removes all occurences of a specified string from a text file. I'm having trouble with tying in everything to make it work, so that the user is prompted to enter a string. This is what I've got: import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; …

Member Avatar for JamesCherrill
0
456
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
968
Member Avatar for collin_ola

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!). …

Member Avatar for rubberman
0
139
Member Avatar for collin_ola

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 …

Member Avatar for collin_ola
0
313
Member Avatar for seanj1992

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 …

Member Avatar for Traevel
0
185
Member Avatar for sahar.97

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] …

Member Avatar for stultuske
0
230
Member Avatar for anandhachandru

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 …

Member Avatar for Ewald Horn
0
333
Member Avatar for Kelly_4

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. …

Member Avatar for Schol-R-LEA
0
138
Member Avatar for Shushan_1

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 …

Member Avatar for JerrimePatient
0
3K
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
230
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
211
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
202
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
115
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
93
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
196
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
141
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
424
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
528
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
922
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
245
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

The End.