36,051 Topics

Member Avatar for
Member Avatar for privatestatic

hey guys i got this new project for my java class and got the overall idea but my code still does not seem to work ...here are the directions: - make a 5X5 boolean array assign 5 random elements for 5 ships - user can have 15 guesses to find …

Member Avatar for JKP()
0
965
Member Avatar for abhay1234

Hello i have created a webpage for a project using jsp in netbeans. I have created a listbox. I want it to display data from database(MS-access) and I should then be able to modify data in database like I should be able to change an entire record through the listbox …

Member Avatar for abhay1234
0
183
Member Avatar for techie929

Hi everyone, I have to read a RGB image and then convert it to YUV. Could any one please tell how should i do this? Thanks.

0
60
Member Avatar for ToXSiK

[CODE] private void depositButtonActionPerformed(java.awt.event.ActionEvent evt) { AdminLoginPage adminLogIn = new AdminLoginPage(users.get(accountNumber).userName, "deposit", users.get(accountNumber).balance, Double.parseDouble(depositAmountTextField.getText()), users); adminLogIn.setVisible(true); customUserDetails1.setText("Welcome " + currentUserName + "! You Have $" + (adminLogIn.getBalance()) + " Available."); depositAmountTextField.setText(null); } [/CODE] AdminLoginPage is a JFrame Constructor Class that displays a certain users account information and asks for an …

0
70
Member Avatar for jemz

Hell can you help me on this,how can i insert a new node in the binary tree and to keep track the current node example: input number: 50 Succesfully inserted! input number:40 this will print "inserted at the left of 50" input numbr: 80 this will print "inserted at the …

Member Avatar for jemz
0
284
Member Avatar for hallinan

Hi, sorry a bout this question but I have no Idea how I would texture something drawn by using glDrawElements? From what I gather you need to use glTexCoordPointer? but I'm still really confused. [CODE] public class DrawWater { public Expr2 func; // The function that is being drawn. private …

Member Avatar for emilo35
0
376
Member Avatar for cretaros

Help me in correctinf the errror i encounter here, i want the image file i have selected using Jfilechooser to be set on the image panel. i tried this but it failed: picthandler.setImageIcon(file); Here is the class Code , i have commented exaclty whr i want the bug to be …

0
81
Member Avatar for kodera

I am a beginner JAVA coder, and yes this is a homework assignment for a online class... I am stumped, and cannot get help fast enough when it is 11pm at night :<) To better explain, I need to be able to have four methods. My first method contains all …

Member Avatar for Akill10
0
919
Member Avatar for sateal8

I am trying to write this program to get a user inputed number of grades up to 15. I then need to add the grades, find the largest, smallest and average of the grades, and finally display the results. Here is what I have so far. I can get past …

Member Avatar for Akill10
0
216
Member Avatar for ToXSiK

Hey everyone, and thanks for taking the time to read my post. Basically, I have a JFrame called "loginPage", that, well, is a login page. If a user logs into this page with the correct credentials, a new JFrame object called accountDetails opens (Or is constructed). Now, Is there a …

0
53
Member Avatar for lilk132z

I am trying to create an applet for people to enter information, and the program should return a certain stat. However, after the user inputs all of the necessary information, no data is returned but this error message is: Exception in thread "main" java.lang.NullPointerException at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:991) at java.lang.Double.parseDouble(Double.java:510) at Player.toDouble(Player.java:110) …

0
54
Member Avatar for Dean_Grobler

I'm busy working with servlets now and when I try and compile them, I get erorrs stating that it can't find javax.servlet etc. Getting errors where I do the import statements to them. So apparently I have to add that servlet.jar file to the CLASSPATH? And that file can be …

Member Avatar for peter_budo
0
659
Member Avatar for pradeesh.login

can anybody describe me about java speech api with an sample code, and also how to get the java speech package and how to use in netbeans software?????:( rely me as soon as possible

Member Avatar for peter_budo
0
37
Member Avatar for patrickgormally

The monthly payment on a loan can be calculated using the following formula: amount * R monthly payment = -------------------- -N 1 - (1 + R ) where: amount is the amount of money borrowed R is the monthly rate of interest for the loan N is the number of …

Member Avatar for Akill10
0
192
Member Avatar for kodera

This will not run, and I am pulling it straight from the how-to.... [code] public class add { public static void main(String[] args) { int sum = add(5, 2); System.out.println("Sum is " + sum); public static int add(int firstInt, int secondInt) { return firstInt + secondInt; } } } [/code]

Member Avatar for Akill10
0
76
Member Avatar for angskie20

hello every one..I'm IT student i do understand it's logic and algorithm but I'm having hard time in programming.. I do hve weak foundation in Programming..can i ask help from u for my assignment? Problem: Write a program that reads student scores, gets the best score, and then assigns grades …

Member Avatar for stultuske
0
347
Member Avatar for ajayb

public static boolean compare(int[] a,int n) { for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if((a[i]*a[j])%2==0) return false; else return true; } } } there's an error coming when I try to include this function in my prog. I think the place of return true is causing problem.When I write the return …

Member Avatar for ajayb
0
126
Member Avatar for ankurmawanda

i am having some connectivvity issues i am using postgres 9.0 sql db i have installed a dns localhost using the postgres sql driver also i have the jdbc jar files in the lib dir of the tomcat my code is [CODE] <%@ page language="java" import="java.sql.*" %> <% Class.forName("org.postgresql.Driver"); Connection …

Member Avatar for masijade
0
298
Member Avatar for Kate Teoh

Hi, I have a problem about update table in a database. The situation is I have a table named member which store thousand rows of data records about thousand of member for a system. This member table has a field named MemberExpiryDate which used to store each member expired date. …

Member Avatar for Kate Teoh
0
126
Member Avatar for surrey_sailor

Hi, I am a newbie with js so I hope that someone can help me please. I want to make a table with resizable columns. The code here seems to almost do what I want. [URL="http://bz.var.ru/comp/web/resizable-tables.js"]http://bz.var.ru/comp/web/resizable-tables.js[/URL] I have commented out the two lines below so that the columns that are …

0
35
Member Avatar for curbster

Hi I'm in my first Java class, towards the end and am struggling with some code dealing with arrays. I'm not looking for the answers but am spinning my wheels (as usual) and am stuck on a particular problem. I'll list the problem here and then explain where I am …

Member Avatar for Akill10
0
12K
Member Avatar for ticktock

Hey all I am a month or two in coding in java and currently I am doing a java calculator gui project, my professor requires us to code the gui by hand, and I did so with a panel and gridbaglayout layout manager, anyways since this is a calculator I …

Member Avatar for ticktock
0
671
Member Avatar for yapkm01

I would appreciate any help on the above. All my process and issues is in the attachments. ps: Java 1.6 tomcat 5.0.28

Member Avatar for yapkm01
0
237
Member Avatar for jsefraijeen

good day sir's/ma'am , please help on how to search an inputted elements to an array... for example... i added a name "JOSEPH" and Address "ILOCOS" and i got an option search in my code and i don't know how i will gonna it... please help me.. [CODE]import java.util.Scanner; import …

Member Avatar for jsefraijeen
0
133
Member Avatar for jackmaverick1

When I declare a class or an instance of the class, I get the error, error: redefinition of 'class player' then after, I get, error: previous definition of 'class player' by the way, I am using gc++. If you want to see the source, just ask. thanx, JT

Member Avatar for Fbody
0
8K
Member Avatar for hanvyj

I have a bit of a puzzle, My default buttons (for when they are only an image) have this "highlight" listener, when the mouse enters/exits it draws a border to give the user some feedback. Its worked fine untill now, where I have a "close" button that, when clicked, removes …

0
51
Member Avatar for stephy1
Member Avatar for stephy1
0
375
Member Avatar for stephy1

I have 3 threads. 3 are going to do a different tasks , so different run() methods. How to overload run() method?

Member Avatar for stephy1
0
90
Member Avatar for stephy1

I got error :At the constructor MyStackThreads "class , interface or enum expected" [code]import java.util.*; import java.io.*; class MyStackThreads extends Thread { Stack thestack= new Stack(); String expression; String splitexpr[]; MyStackThreads[j] { public void run() { try { DataInputStream dis=new DataInputStream(System.in); expression=dis.readLine(); for(int i=0;i<expression.length();i++) { splitexpr=expression.split(expression); thestack.push(splitexpr[i]); } } catch(IOException …

Member Avatar for stephy1
0
385
Member Avatar for manish250

hello all i have a jsp page.there is a text box in jsp page.what i want is when i enter a key in text box it accepts it only if it is alphabet otherwise it would give an alert.I want to enable arrow and backspace and delete key.Currently i am …

Member Avatar for peter_budo
0
124
Member Avatar for Manojo7

HI guys , i'm new to this community. plz help :'( i'm doing a project which is called Online Examination.. can i give a variable as value in radio button???? Here is my code [CODE] <% try{ int num; double d=Math.random()*10; PrintWriter oo=response.getWriter(); num=(int)d; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mno"); Statement stmt=con.createStatement(); ResultSet …

Member Avatar for peter_budo
0
103
Member Avatar for erickvla

Hello guys, anyone knows where can I get the "Spring in Action" book on PDF format? Thanks!

Member Avatar for peter_budo
0
118
Member Avatar for vigneswaranm

I want to configure apache with JBoss.., I download Apache 2.X version it starts properly.,And I configure mod_jk and all steps.but,localhost is not working..,

Member Avatar for peter_budo
0
63
Member Avatar for astrojunk

Hi. I'm working on an address book (JDK) which prompts the user to enter 1 if he wants to add an entry, 2 if he wants to search for a name, or 3 if he wants to quit. I'm done with the 'add entry' and exit parts but I couldn't …

0
73
Member Avatar for jecris

In Dorothy Sayers' novel "Have His Carcass", Lord Peter Wimsey describes a cryptography technique that is simple for encoding and decoding, yet relatively hard to crack. Your job is to implement this technique. Here's how it works, in Sayers' (edited) words: You choose a key-word of six letters or more, …

Member Avatar for masijade
0
95
Member Avatar for jecris

Reversed number is a number written in Arabic numerals but the order of digits is reversed. The first digit becomes last and vice versa. For example, if the number is 1245, then it becomes 5421. Note that all the leading zeros are omitted. That means if the number ends with …

Member Avatar for masijade
0
126
Member Avatar for jecris

A number is "prime" if it has no divisors other than itself and1. For example, 23 is prime and 35 is not prime because 35 = 7 x 5. If the digits of a number are rearranged, then usually its primeness changes - for example, 32 is not prime but …

Member Avatar for masijade
0
113
Member Avatar for jecris

A common problem when processing incoming text is to isolate the words in the text. This is made more difficult by the punctuation; words have commas, "quote marks", (even brackets) next to them, or hyphens in the middle of the word. This punctuation doesn't count as letters when the words …

Member Avatar for masijade
0
143
Member Avatar for jecris

Anyone have code with this?... Write a program to find the chain associated with any given number. Start with the given positive integer. This is the first number in the chain. Sort the digits (of the base 10 number) into ascending order, and also in descending order. Subtract the ascending …

Member Avatar for masijade
0
473
Member Avatar for lisaroy1
Member Avatar for mangopearapples

Hi, I was wondering how I can use this type of list: [url]http://palib-dev.com/manual[/url] On the left, there are expandable lists. How can I use them? Thanks.

Member Avatar for mangopearapples
0
144
Member Avatar for pruthvikumarbk

Hi, I need to know how to deploy struts from scratch in RAD. If any one knows how to please help. Thanks, Pruthvi

0
53
Member Avatar for kay19

Well, I first made a topic about JDK commands not inputting, but fixed it now. I usually do my work in class when it comes to textpad - java, but right now, working at home. Here's my problem - I can't get it to compile. It gives me an error …

Member Avatar for kay19
0
513
Member Avatar for Davitch

Okay, I am so close to this one I can taste it. I am trying to get the average mileage between two different tanks of gas in this code. I have most of the code written out, but I know there is something missing, so here we go! [CODE]import java.util.Scanner; …

Member Avatar for adarshcu
0
118
Member Avatar for Transcendent

I'm trying to print the average of this: [CODE]public class Grades { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int [] work = {20, 90, 100, 50, 80, 70}; for (int workValues : work) System.out.printf(" %d", workValues); System.out.println(" "); getAverage(work); modifyElement(work[0]); …

Member Avatar for Transcendent
0
140
Member Avatar for Oddone

This is basically to request help with my program, as was already evident. I am a student, and an assignment asks me to "Write a method that computes the spherical distance between two points on the surface of the earth, given their latitudes and longitudes." I have written this so …

Member Avatar for Oddone
0
167
Member Avatar for speedy94519

Hello, I have a question about the code below [CODE] // Checks the vertex a if (this.a != ((Triangle)o).a) { return false; } [/CODE] So In a method called Triangle i declared an instance variable like this: [CODE] private java.awt.Point a [/CODE] What I think this code is doing is …

Member Avatar for jon.kiparsky
0
152
Member Avatar for sainzkr

Im running into a problem in my code and cant figure out how I can get it to restart or exit upon completion. public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Welcome to Morgage Calculator", "McBride Financial INC", JOptionPane.PLAIN_MESSAGE); String princible; princible = JOptionPane.showInputDialog(null, "Step 1: Enter Mortgage Amount" ); String …

Member Avatar for jon.kiparsky
0
93
Member Avatar for mjv89

Hi, Sorry for another thread. I'm trying to do matrix multiplication in Java now. Here's my code (that wont work). Please let me know if you spot anything that I should change... [code] class multiply { public static void main(String[] args) { int[][] a = {{1,2,3}, {1,2,3}, {1,2,3}}; int[][] b …

Member Avatar for jon.kiparsky
0
133
Member Avatar for mjv89

Hi, I'm trying to learn more about matrices in Java. I am trying to read in two integer matrices A and B, then print out the calculation for A + B, but I am getting an ArrayIndexOutOfBoundsException on line 21. Any help would be greatly appreciated. [code] class MatrixAdd { …

Member Avatar for mjv89
0
91

The End.