32,199 Topics

Member Avatar for
Member Avatar for subith86

In C++ I'm able to do something like this [CODE](some_condition)? function1():function2();[/CODE] When i tried the same thing in Java it's not possible. It wants some variable to hold the result even though the return type of function1 and function2 are void. Is there any other way to do it other …

Member Avatar for subith86
0
130
Member Avatar for SavnetSinn

I'm working on a small game in my free time as a proof-of-concept to myself that I'm capable of learning Java, but I've been stumped on an issue for the last week or two involving the instance of KeyListener I created for my project. Basically, the game has a player …

Member Avatar for jon.kiparsky
0
150
Member Avatar for abz2010

can anyone help me with this java coursework please? i am lost and don't know what to do and where to start. this is coursework, implement a peice of software suitable for use by a cinema. the system should be capable of providing information about films currently showing, and of …

Member Avatar for jon.kiparsky
0
134
Member Avatar for lynnajoe

Hi, Yes, I am sure you can tell that I am new. I have a few question and hope someone will answer them. 1)I am a little confused as to where to put certain code. If I am doing inventory and I need to have an array does it go …

Member Avatar for jon.kiparsky
0
82
Member Avatar for server_crash

I made this simple program that prints out all the factors of a given number. The only problem is that it prints out the numbers in different order...For example: factors of 12: 1*12 2*6 3*4 but this is what my program prints out: 1*12 2*6 3*4 [B]4*3 6*2 12*1[/B] It's …

Member Avatar for Momerath
0
157
Member Avatar for bindhub

SEN 964 Object-Oriented Design in Java Assignment #2: ITU wants you write some classes for their Personnel Record System. To make it simple, consider only 4 classes: Person, Employee, Instructor and Student. The following figure illustrates the relationship between these 4 classes. The Person class is the parent class of …

Member Avatar for stultuske
-3
1K
Member Avatar for Alex Edwards

Solves simple string-based expressions. Currently only supports integers, but can easily be expanded to support float-types.

Member Avatar for Taywin
1
3K
Member Avatar for Harekc

pls i need help after i have compiled my java frame using the awt package to display images the frame shows without the image and after compiling an animation program, the frame still shows without the animation.

Member Avatar for Taywin
0
121
Member Avatar for altayar

Hello .. I am trying to open an encrypted file, and then pass it to my decryption method to decrypt it and display the text on the screen .. I'm getting a null! This is my decrypt code: [CODE] public String decrypt(String encrypted) { StringBuilder decryption = new StringBuilder(); for(int …

Member Avatar for Taywin
0
101
Member Avatar for bharath54321
Member Avatar for l_savitha

Can any one suggest how to proceed with this. On clicking on print button it should start printing on the console while the other button end is clicked it should stop printing. When print button is clicked end button click is not recognised until process is print process is completed

Member Avatar for l_savitha
0
117
Member Avatar for gingank

Hi All, I need ask something on the iReport I already set a field called country and the data pull from the database so it like that $F{country} the country = "KO" detected change to "KOREAN" my statement is like this but come out error If $F{country} = 'KO' { …

0
76
Member Avatar for gunjannigam

I have to draw a Circular gauge using Java Graphics. Somewhat similar to the attached image, the circular gauge without the black border as in image. I tried to use two methodologies but none of them is working perfectly Firstly, I tried to draw everything using Java Graphics and then …

Member Avatar for gunjannigam
0
491
Member Avatar for caswimmer2011

Hello, I am making a simple program that has you select Bible chapters and verses. I have all the chapters and verses in separate text files. I moved them into my source package. I am having trouble finding the code to put in the program so that java will open …

Member Avatar for vadayattu
0
222
Member Avatar for 'Stein

Check this out. Open up any website (one with many pictures is better) and, after loading it, paste this code in the address bar: [code]javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0);[/code] :)

Member Avatar for susheelsundar
0
591
Member Avatar for Rakesh Mall

Hi I want to know that howmay type of java and also that what is the use of different type of java?

Member Avatar for Zorbie
0
85
Member Avatar for prem2

Dear all, I have using db operations such as insert,update,select,delete in my program .I have perform this operation using the prepared statement. How to avoid the sql injection in my java program.? *)I want to know functions to avoid the escape characters in java ? *)Did any one know what …

Member Avatar for Taywin
0
1K
Member Avatar for Gsterminator

The objective of my program is to sort a file of students in order from a-z using arrays. I'm using selection sort method but for some reason my code is matching what i want. for example: Enter name of a file of Students: student10.txt In forward order, students are: Sally …

Member Avatar for Taywin
0
139
Member Avatar for insanely_sane

Ok, so you know how, if we want to output the elements of an array to the screen, we have to make a for loop right? So I have the following code... [CODE] char array[] = new char [10]; array[0] = '1'; array[1] = '2'; . . . . array[9] …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for azibhai4u

Hiii all I am using java 1.6 and RXTXComm package (Javax.comm) package. I can read data from a electronic weighing machine. Now I have to set the weight as zero. I can tare this weight by sending T command to serial port. I had tried several times but no response …

Member Avatar for ferdousKhanom
0
658
Member Avatar for ferdousKhanom

I need to open a serial port on Windows XP. I'm pretty limited on programming languages but can code Java and C. [B]Javax.comm[/B] package is no longer supported - third party isn't very good [I]either[/I] :S so [COLOR="Red"]how[/COLOR] do I open a port? at the moment all I want to …

0
111
Member Avatar for z00t

Q: A local company has the following monthly charges for snowclearing services: $250 for 0-5 visits $250 + $55 for each visit over 55 13% tax is to be charged in each case if previous balance is not zero, intrest of 4% of that balance is to be charged. theres …

Member Avatar for jon.kiparsky
0
161
Member Avatar for samppb

Hello All, I am beginner to Java and am in the process of learning. I am currently focusing on understanding the Thread concept. Went through various materials available in the internet, but not sure whether I understood it(thread concept) clearly. Here is what I have written: A simple java applet …

Member Avatar for Ezzaral
0
125
Member Avatar for dawnoflife

I can't seem to debug these run-time errors. help would be appreciated. [ICODE] Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:840) at java.util.Scanner.next(Scanner.java:1461) at java.util.Scanner.nextInt(Scanner.java:2091) at java.util.Scanner.nextInt(Scanner.java:2050) at lab2.readFile(lab2.java:92) at lab2.main(lab2.java:79) [/ICODE] [CODE] import java.io.*; import java.util.*; class Customer { int account_id; char[] ch1 = new char[20]; String name = new …

Member Avatar for jon.kiparsky
0
186
Member Avatar for souma123

Hi all, Please i need to know how to install fxtrade in myeclipse . Thank you in advance

0
48
Member Avatar for nickcolb

Hey guys, I need some help with this coding. I feel like it's something simple so hopefully someone can figure it out. I know for certain that it has to do with float-int conversion problems, and I feel like once I figure that out the rest should fall into place. …

Member Avatar for JamesCherrill
0
183
Member Avatar for Johanng83

Hi everyone, I'm new to Java and i have a simple question but i don't understand it, can someone help me pls? In this exercise, we will use the String class to manipulate string variables. Write a program that reads in two String variables from the user and store in …

Member Avatar for peter_budo
-1
102
Member Avatar for Transcendent

a) Output the date in multiple formats, such as i) MM/DD/YYYY ii) February 25, 2011 iii) DDD YYYY I'm supposed to do this: b) Use overloaded constructors to create Date3 objects initialized with dates of the formats in part (a). In the first case, the constructor should receive three integer …

Member Avatar for JamesCherrill
0
2K
Member Avatar for titan5

I have created 2 menus using JForms. I have two buttons in the 1st menu (menu1.java) I want to go to the second menu (GUI of menu2.java) whenever I press button 1 in menu1.java. How can I do that. What should I write in the actionListener func for button1?

Member Avatar for titan5
0
115
Member Avatar for miminj

Create a class called Student. This class should have the following twelve private data elements: String studentName String studentEmail String studentLocation int projectGrade1 int projectGrade2 int projectGrade3 int projectGrade4 int quizGrade1 int quizGrade2 int finalExam int participationGrades This class should have the following public methods: A get method for each …

Member Avatar for Akill10
0
234

The End.