32,204 Topics

Member Avatar for
Member Avatar for ilovejava

This is a frighteningly subtle bug I first learned about in C (Andrew Koenig's ``C Traps and Pitfalls''), but it's still with us in Java, and I assume C++ as well... The following method looks like it should always return the absolute value of n, but every once in a …

Member Avatar for stultuske
0
412
Member Avatar for javanewb

Hello, this is my first post. I have this homework assignment, and it is completed and it works! my question is just if anyone has any suggestions to clean it up or make it more efficient? I have two seperate files GuessTheNumber.java which is: [CODE]// GuessTheNumber.java //Written by Sean Kelley …

Member Avatar for frank33
0
232
Member Avatar for ougesh

I want to write a function to accept a single string that represent a credit card number as parameter and validates it with the format 9999 9999 9999 where 9 is any digit and each quadruplet is separated with a single space.

Member Avatar for stultuske
0
172
Member Avatar for begprogram

hi there, im very new to programming and i have trouble coding a application that prompts the user for s series of first names and then display the number of names entered and then the name with the most characters in uppercase letters. the application output should look similar to …

Member Avatar for stultuske
0
108
Member Avatar for dimitros

I cannot figure out why i have this error.It may just be a missing semicolon but i can't find where. Here is my code:(error occurs in many lines, so i can't show where exactly is the problem) /* * To change this template, choose Tools | Templates * and open …

Member Avatar for stultuske
0
589
Member Avatar for Ashenvale

Hey guys :idea: This is my code [CODE]studNo = JOptionPane.showInputDialog(null, "Enter Student Number: "); studName = JOptionPane.showInputDialog(null, "Enter Student Name : "); prelim = Float.parseFloat(JOptionPane.showInputDialog("Enter Prelim grade : ")); midterm = Float.parseFloat(JOptionPane.showInputDialog("Enter Midterm grade : ")); finals = Float.parseFloat(JOptionPane.showInputDialog("Enter Final grade : ")); overallGrade = (prelim * .2) + (midterm …

Member Avatar for stultuske
0
279
Member Avatar for chiiqui

I am in need of creating a payroll system, I have created setters and getters for classes such as Persons, and COntactInformations, I am wondering how would I put each objects value or the value of it's attributes?

Member Avatar for peter_budo
0
88
Member Avatar for poojavb

Hello All, I am stuck in one issue. When I update a value in one tab of a JTabbedPane, the same value does not get updated in the other tab I tried using the StateChange event but still did not succeed. I need to refresh the second tab as soon …

Member Avatar for poojavb
0
394
Member Avatar for sudarshansirsat

Note: error is comming @ line: 59 This is the source code where i m getting nullpointer exception , I am unable to know where exactly this is not getting value. this code is working at another machine but not on my machine though i compiled it from machine on …

Member Avatar for sudarshansirsat
0
373
Member Avatar for jackmaverick1

My problem is that when I try to gather the parts of an array, the part of my code that decides what to keep seems to be making a mistake, though I can't fathom how it is making that mistake. My code is posted below. You should see the parts …

Member Avatar for NormR1
0
319
Member Avatar for akshayinbox

Hey. I came across a website where there was a textarea with formatting enabled (just like this one). I pasted some text from MS WORD and it could detect the source of the data: MS WORD. How is this possible? Thanks.

Member Avatar for NormR1
0
67
Member Avatar for kmbl84

[I]Hi, I writing a "Math Game program" which does the follow: Generate random two operand problems. Allow to the user to enter the solution Each time the user gets a correct result then display a random encouraging message. Similar for incorrect attempts. This program works good in BlueJ, BUT when …

Member Avatar for NormR1
0
334
Member Avatar for fausto1234

Here is a summary of my project. I have a cash for metals company that has both personal and commercial customers. Customers can alos acumulate interest if they keep their money with the company. Some customers are repeat customers, therefore i need a way to keep track of multiple transactions …

Member Avatar for NormR1
0
133
Member Avatar for cms271828

Hi, I've just completed my chess program in java. Its at [URL]http://www.colin-java.co.uk/JChess/index.htm[/URL] I'm looking for a new project now, something to take my time up. Any good ideas. :?:

Member Avatar for SylvesterAbreu
0
292
Member Avatar for aanders5

So I have this website that has a chatbox. I now have an offsite way to chat to the chatbox and get chats from it, the problem is that it only updates other users chats when I post or manually hit refresh, is there a command in java that will …

Member Avatar for Ezzaral
0
184
Member Avatar for bzmommy

I finished the part one to this but am having a difficult time to make it work . Any feedbacks from people who might have done it? Please select from the menu below: 1. Create Personal Customer 2. Create Commercial Customer 3. Record Transaction 4. Make Withdrawal 5. Display Customer …

Member Avatar for fausto1234
0
183
Member Avatar for nsyncpilu

Hy , I have to encrypt a message and then decrypt it. I have this code , but i need to save the encrypted string in a database and the code generates a random key every time. I could save the string and the key in the database but that …

Member Avatar for nsyncpilu
0
437
Member Avatar for Mehnad

here is my entire code. now, the only problem I have stumbled upon is in the last method, getRow, where i have to extract a row from an array of string. could anyone please help me with this, i've been stuck for hours, not knowing why it calls "missing return …

Member Avatar for Mehnad
0
451
Member Avatar for rahul.ch

Hello, I have just started studying EJB. There is this term narrowing in JNDI chapter which I'm frankly stuck at. Could anyone please explain in simple term what exactly it does. And also explain in parts this snippet: [I][B]javax.rmi.PortableRemoteObject.narrow(obj, SignOnHome.class); [/B][/I] Thanks in advance.

0
65
Member Avatar for matt1117

Ok so i have this work for my java class done so far. And i cannot figure out how to get the different letters from an inputted word to output as a number. The assignment is get a user to input a 7 letter word and output it as a …

Member Avatar for StephNicolaou
0
3K
Member Avatar for Deincross

Hello all the gurus out there, I'm working on a project that requires me to log method calls that occur in a running Java program, I did some research for the past two weeks and learnt that instrumentation might be the way to go but it's largely complicated for my …

Member Avatar for Deincross
0
341
Member Avatar for iustitia

Hello I have a problem that I cannot solve by myself. I'm making kind of calculator. I wanted to make one general method that handles all events for some buttons, because all of them are similar. My problem is that in NetBeans code for handling events is generated automatically and …

Member Avatar for stultuske
0
104
Member Avatar for jhamill

Hey all, so now im trying to code a simple game where each time an image is clicked on it is randomly regenerated somewhere else on the JFrame. I'm having some trouble with the logic though. Any help would be appreciated, thanks! heres all the code, theres 3 classes [CODE]package …

Member Avatar for JamesCherrill
0
135
Member Avatar for logicmonster

I'm getting into some territory I have never treaded before.... What I have is an Abstract class "Person" with an abstract class "Employee" that extends "Person" and then three concrete classes within "Employee" named: Agent, Accountant, and WebDesigner. sudo: [CODE]abstract class Person{ abstract class Employee extends Person implements myInterface{ class …

Member Avatar for logicmonster
0
261
Member Avatar for needhelpinjav

Please, please don't tell me to stop being lazy and do this myself. I'm really struggling in my java class and I wouldn't be online asking strangers for help if I wasn't desperate and didn't already try to do the work myself. I've been on a number of programming help …

Member Avatar for stultuske
0
287
Member Avatar for begueradj

Hello people, I designed this class: [CODE] package aiproject; /* * This class has the task to read the data stored in a file called "fichier.txt" * line by line. * The read lines will be put inside a List called lignesDeMonfichier * Also, this class counts the number of …

Member Avatar for JamesCherrill
0
316
Member Avatar for riahc3

(So continues the JNI saga....) I currently have this (in C++, this being my native code in C++): (x is a jstring passed thru the header) [code] jdouble res; if (x=="*") { res=a*b; } else if (x=="+") { res=a+b; } else if (x=="-") { res=a-b; } else if (x=="/") { …

Member Avatar for riahc3
0
144
Member Avatar for riahc3

(More JNI woes...) When I try to comply this code [code] import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class HacerOperacionesConJNI */ public class HacerOperacionesConJNI extends HttpServlet { private static final long serialVersionUID = 1L; private native double operaciones(double a,double b,String op); …

0
70
Member Avatar for asif49

I have to make a program where there are employees who are created then can be assigned to multiple jobs, here's how I've done it... MAIN class [CODE] Employee [] e = new Employee[10]; //class to contain/manipulate 10 individual employees Job [] j = new Job[10]; //class contain/manipulate 10 individual …

Member Avatar for JamesCherrill
0
121
Member Avatar for khaled_jawaher

i m using mtom feature in jaxws web service to send image from server to client and i m getting the following error pls i apreciate any help. error is Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/x ml/stream/buffer/XMLStreamBuffer at com.sun.xml.ws.api.addressing.AddressingVersion.<init>(AddressingVers ion.java:436) at com.sun.xml.ws.api.addressing.AddressingVersion.<init>(AddressingVers ion.java:67) at com.sun.xml.ws.api.addressing.AddressingVersion$1.<init>(AddressingVe rsion.java:146) code is [CODE]package services; …

Member Avatar for ~s.o.s~
0
557

The End.