31,001 Topics
| |
I'm using Eclipse and when I try to build the JMS example included in j2ee tutorial, it return a NullPointerException at this: [code]connection = connectionFactory.createConnection();[/code]. Here's the code of that example: [code]public class Producer { @Resource(lookup = "jms/ConnectionFactory") private static ConnectionFactory connectionFactory; @Resource(lookup = "jms/Queue") private static Queue queue; @Resource(lookup … | |
What I'm trying to do is to take 7 of the scores from judges and discard the lowest and the highest score then average five scores that remain after. I got to where I can get all of the scores, but I have no idea how to take the lowest … | |
Hi guys, I am writing a small application which needs to load some images, and other resources. I am currently trying to find the best way to package these resources in my application. I have looked at some examples, I but I have been having trouble understanding them, and many … | |
Hello, I need to send messages to Android phones through P2P on 3G connection. Sending and receiving works perfectly on lan ip addresses(on wi-fi) but not on 3g or 2g. On 3g I send a message but it never appears on the other end of the line. Can anyone tell … | |
Can I ask for some advice / help please, I am writing a UI that upon the user making a selection from a drop down list it then populates details about the selection in text boxes. I am writing this as three classes the main class, the UI (User Interface … | |
Design and implement an object-oriented program describing two kinds of BANK accounts, [B]FixedFee[/B] and [B]ChargeableFee[/B], that differ in the way that fees are charged: • FixedFee: There is a fixed £5.00 fee at the end of the each month • ChargeableFee: Each withdrawal costs £0.50. The total fee is calculated … | |
[CODE] import javax.swing.JOptionPane; public class Test1 { public static void main (String[] args) { // Method 1 Test3 method1 = new Test3(); // is this the method to call Test3()? JOptionPane.showMessage (null, method1 // Method 2 JOptionPane.showMessageDialog (null, Test3()); // Method 3 JOptionPane.showMessageDialog (null, Test3.toString()); } } class Test2 { … | |
[CODE]import javax.swing.*; class Month { public static void main(String[]args) { String value=JOptionPane.showInputDialog(null,"Enter Month Day and Year"); if(value.length()==10) { char Month=value.charAt(0)+value.charAt(1); char Day=value.charAt(3)+value.charAt(4); char Year=value.charAt(6)+value.charAt(7)+value.charAt(8)+value.charAt(9); JOptionPane.showMessageDialog(null," "+Month+"/"+Day+"/"+Year+""); } else { JOptionPane.showMessageDialog(null,"INVALID INPUT!!"); } } }[/CODE] Hello i need help about combing the charAt()'s for example i would input 05/05/2010 i want … | |
hi there. Just wanna check if I am coding this wrongly, [CODE]int sumOfVotes = 23 int howlong = 94 double SimPercent = ((sumOfVotes / howlong) *100);[/CODE] Shouldn't the answer, SimPercent, be 24.4? Tks! | |
Hi, I got a compile error of incompatible types - lang.object is found but int expected on line 21. But when i put int in front of square, it says .class error:/ P.S. I didn't write everything here, I got some codes from other programs:P [CODE]import java.util.ArrayList; /** A magic … | |
Hello everybody; m screwed by searching, and dont get any satisfactory material, i want to know that, if i have a button of NEXT then how it will close that GUI and open the new one from another class?? kindly help me | |
i need to write a code that will download an excel file from a website every time it is ran. what im trying to do is automatically import real time electricity rates into excel. im a beginner in programing and am seeking help for my senior design project. Thank you | |
i want to download a file from ftp to my local machine using java code. Can anyone help me out pls?? n provide the jar file used in the code. | |
hello; i have gui on which i have a button of ADDMEMBER and this is in my package of Member; now i want to open another gui from another package of LIBRARY; how i will do it?? i have searched it alot kindly answered me .... Thnx | |
I have this recursive method that counts the amount of negative numbers that lie in the array called "NumArray" [CODE]public static int countNegative(double[] NumArray, int startIndex, int endIndex) { if (startIndex == endIndex) { if (NumArray[startIndex] < 0) { return 1; } else return 0; } else if (NumArray[endIndex] < … | |
I'm trying to evaluate postfix expressions but i cannot get it right. I always get the result value as 0 and in my evaluate method it keeps saying my num1 num2 and result have not been initialized. Any help is appreciated. [code] package collection; import java.io.*; public class Postfix { … | |
Hello, I'm having trouble translating an algorithm. I'm not sure I coded bits of this correctly, but I'm certain that I have no idea how to compare an item with a node identifier (cannot apply > operator with T,T) but since this is an insert sorted method rather than insert … | |
So I'm suppose to create some code that will perform some methods in recursion. Here's the prompt: [I]Assignment #9 will be the construction of a program that reads in a sequence of numbers (not necessary integers) from standard input until 0 is read, and store them in an array (including … | |
Hi Guys, I'm trying to have the user enter an integer than an outline of a pyramid would be printed on the console. I just can't get the last line to print out with "*" all across. So say a user enters 5 I need the output to be: [CODE] … | |
Hi. I'm new to this forum and to programming in general. This is my first programming class and it is in JAVA. I have been doing alright in the class, but am really struggling with this weeks program assignment. If you could help me out at all I would really … | |
write a public class called IfElseDemo. Create a Method called go [I][B]that takes the args String array from the main method[/B][/I]. in that method create an if/else block that looks at the first element of the array and uses the string equals method to determine the output. if it contains … | |
Well I am now starting a new program and it evolves get the users height, weight, age and then calculating it into hat, waist, jacket sizes. I have to have four made methods in it also. One for each clothing size and on for asking the user if they want … | |
Hi, I need help in creating a never ending array using java. It should basically work like and ArrayList but should be done using arrays. | |
Hello. I have been reading some stuff on the action command pattern. ever heard of it? More inportantly, Do you understand it? Because I do not. although I would like to ask if the following class could use the command pattern as aposed to 'if" or "switch" statements. I understand … | |
To code pretty much makes a grid of a check board. However I want to modify it so if I click on any cell of the grid of the checkerboard it will display a red circle. If I click on a cell that already has a circle, it will remove … | |
Hello everybody! I have to Questions to ask please: 1) How can I find the maximum value in a single linked-list recursively? this is what I tried to do: int findMax(int key){ Node max=head; while (max != null){ if (max < max.getKey()) return(max.getNext()); } } it ends up to an … | |
The task is to be able to move the alien right, down, and left. So far all i can get the alien to do is move right and down. I need to get it to be able to move left. Can you help me please? import java.awt.Graphics; import java.awt.Image; /** … | |
Hello Members, Can anyone recommend any easy-to-use and free Java Script IDEs? Thank you!! sciprog1 | |
Tell me if this makes sense structurally. I have a final this week and this homework will not be graded till after the final. I was just curious if I have as firm a grasp on this as I think I do. [CODE]public class account { private int id = … | |
so the question is to print out strings that appear both in the two given lists, assume each list does not contain duplicates of the same word. so with the signiture of [B]public void intersect(Node n1,Node n2)[/B] and suppose we already have another method: [B]public boolean contains(Node n, String target)[/B] … |
The End.