32,204 Topics

Member Avatar for
Member Avatar for toferdagofer

Im trying to have the center circles follow the mouse if it enters the screen and go back to the original position if the mouse exits screen. Im not sure what to put into my mouse listener and would appeciate some help [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class …

Member Avatar for BestJewSinceJC
0
118
Member Avatar for sciprog1

Hello Members, I have a simple Client/Server program which does the following: Server sends an array of Images one at a time to the Client. Client displays them one at a time. My Server: [CODE]import java.net.*; import java.io.*; import javax.swing.*; public class Server { public static void main(String[] args) throws …

Member Avatar for sciprog1
0
144
Member Avatar for amit.hak50

I want to find it out for the number 2345678901233.. but it is giving the error ..is there any method to find out the primes beyond the range of integer..[code]import java.util.*; public class inc { int flag=0; int h=2; public void checkprime(int k) { while(h<k){ if(k%h==0){ flag=1; } h++; } …

Member Avatar for apines
0
200
Member Avatar for ceyesuma

Hello all. Is there any one that could suggest some key words or links (besides "How to use JTabbedPane") that could generate some links to tutorials that describe how to implement the process of adding tabs to JTabbedPane during runtime? or profide some feedback on what kind of learning trail …

Member Avatar for ceyesuma
0
104
Member Avatar for Overbooked

Hi everyone, I'm working on method to fill a 2D grid with objects. This is what I have at the moment: [CODE]public void fillGrid() { for(int i = 0; i < ROWS; i++) { for(int j = 0; j < COLUMNS; j++) { String displayText = "#"; board[i][j] = new …

Member Avatar for Overbooked
0
89
Member Avatar for supertux

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 …

Member Avatar for JamesCherrill
0
171
Member Avatar for schoolbus11

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 …

Member Avatar for Overbooked
0
108
Member Avatar for Pokenerd

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 …

Member Avatar for lee.j.baxter
0
158
Member Avatar for datasmith

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 …

Member Avatar for anubis_1969
0
165
Member Avatar for Son of a gun

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 …

Member Avatar for Son of a gun
0
108
Member Avatar for rational_

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 …

Member Avatar for apines
0
305
Member Avatar for minimi

[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 { …

Member Avatar for apines
0
141
Member Avatar for intes77

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

Member Avatar for intes77
0
440
Member Avatar for jemimaloh

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!

Member Avatar for jemimaloh
0
97
Member Avatar for serph09

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 …

Member Avatar for hanvyj
0
165
Member Avatar for 080346

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

Member Avatar for kramerd
0
86
Member Avatar for ItecKid

Hello, everyone, Next semester, I will be taking a course in Java programming language, and was wondering if anyone knew of a good IDE that runs in the Red Hat/Fedora environment. (Preferably something installed through YUM.) I tried a Google search on this, yet the only thing I seem to …

Member Avatar for Computerphile
0
387
Member Avatar for dead1

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

Member Avatar for hanvyj
0
78
Member Avatar for sazad1

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.

Member Avatar for sazad1
-1
188
Member Avatar for 080346

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

Member Avatar for hanvyj
0
91
Member Avatar for BboyRodimus

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

Member Avatar for apines
0
1K
Member Avatar for nellyznell

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

Member Avatar for CLina
0
1K
Member Avatar for Iamthecheese

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 …

Member Avatar for kramerd
0
181
Member Avatar for BboyRodimus

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 …

Member Avatar for kramerd
0
496
Member Avatar for biggie_011

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

Member Avatar for apines
0
122
Member Avatar for Roy1287

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 …

Member Avatar for kramerd
0
825
Member Avatar for lu25

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 …

Member Avatar for coil
0
132
Member Avatar for DallasFan3

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 …

Member Avatar for Eric Cute
0
2K
Member Avatar for javajavajava

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.

Member Avatar for Eric Cute
0
215
Member Avatar for ceyesuma

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 …

Member Avatar for ceyesuma
0
118

The End.