32,204 Topics
| |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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. | |
[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 … | |
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 … | |
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. :?: | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
| 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 … |
(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=="/") { … | |
(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); … | |
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 … | |
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; … |
The End.