32,199 Topics

Member Avatar for
Member Avatar for roycy

so I need the answer of this qustion : write program in java to creat array from ten integer and count the number of negtive and positive and zero 45,82,-1,35,-4,0,-8,0,9,-11?

Member Avatar for peter_budo
0
47
Member Avatar for jbvincennes

Hi, I find classes sources on the web that import import org.dyno.visual.swing.layouts.Constraints; import org.dyno.visual.swing.layouts.GroupLayout; import org.dyno.visual.swing.layouts.Leading; But I cannot find this package with google searches. Where is it? Many thanks for your help.

Member Avatar for jbvincennes
0
515
Member Avatar for andimiami

Hello! I am a student (obviously, haha), and I am confused about how I need to do something in my driver class. I have a text file that I am reading in, then I decided to use a string tokenizer to parse the data. Now, I need to store the …

Member Avatar for andimiami
0
194
Member Avatar for anise

[code]import java.util.*; import java.util.Scanner; public class exec { public static void main(String[] args) { int num; Scanner inputDevice = new Scanner(System.in); System.out.println("Enter a letter / integer or -1 to quit:"); num= inputDevice.nextInt(); System.out.println("Enter a letter / integer or -1 to quit:"); num= inputDevice.nextInt(); System.out.println("Enter a letter / integer or -1 …

0
66
Member Avatar for dhija22

HI everyone...i have writing a program in java,but now i ought to write the same progam in uml...do u know if exist andy program that transfer a code from java to uml?thanx ,i am waiting Regards dhija 22

Member Avatar for JamesCherrill
0
87
Member Avatar for vmc

I have done most of the code but am struggling with one bit now, please help The brief is Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, …

Member Avatar for JamesCherrill
0
2K
Member Avatar for akemi3

Hello, I'm currently taking AP Computer Science with no prior experience with programming and I am facing a bit of a problem with the last problem on my programming assignment. You see, what I have to do is write a program that displays a name four times either horizontally or …

Member Avatar for akemi3
0
96
Member Avatar for knight fyre

I'm trying to learn Java Servlets on my own but I'm having some very basic problems. The code [CODE]"import javax.servlet.ServletException;"[/CODE] produces a compiler error, "the import javax.servlet cannot be resolved". I'm using version 3.2.2. Why am I having this problem?

Member Avatar for varun.x.anand
0
621
Member Avatar for vmc

I have done most of the code but am struggling a bit now, please help The brief is Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, and …

Member Avatar for JamesCherrill
0
193
Member Avatar for sirpatrick

how do i learn java gui? i inkow java commands line but am not familia with gui which software i need to , inkow only eclipse,and jdk

Member Avatar for Taywin
0
62
Member Avatar for Pancho jaylana

hey can u help me by dis problem please write the application to display a window with Code GUI..right Now help me

Member Avatar for JamesCherrill
0
132
Member Avatar for TigerTeck

[CODE]public class CashRegister { public CashRegister() { purchase = 0; payment = 0; } public void recordPuchase(double amount) { purchase = purchase + amount; } public void enterPayment(int dollars, int quarters, int dimes, int nickels, int pennies) { payment = dollars + quarters* QUARTER_VALUE + dimes*DIME_VALUE + nickels*NICKEL_VALUE + pennies*PENNY_VALUE; …

Member Avatar for JamesCherrill
0
133
Member Avatar for CKShia

I am writing a simple program to get user input from Scanner to perform some tasks, I want to get user input only from the number 1 to 3, any negative number or string will display an error message and prompt user to re-enter. Here's comes the problem... When I …

Member Avatar for JamesCherrill
0
266
Member Avatar for jeypijeypi

I am creating a web-based app written in JSF and Java. One functionality of the system is that the user can select a text file from his pc and import it in order to get the data inside the text file. Do you have any idea on how can I …

0
111
Member Avatar for MonicaClare

hi.. uuhhmm.. i have a problem in how to put an String Buffer method here in my code.. uuhhmm.. i just want to know the easiest way of putting a String buffer .. please help . . thanks.. [code="java"]import java.awt.Graphics; import java.util.Random; import javax.swing.*; public class Change { public static …

Member Avatar for jade_1453
0
146
Member Avatar for Blink383

I had to reconstruct my program from the last time I had posted for help. My instructor enlightened me that I needed to follow her example to the tea, even though I had the same output that was required, I did not have all concepts required meet. So, after spending …

Member Avatar for Taywin
0
227
Member Avatar for julylee06

Ok, so I need some guidance. Am trying to implement a linked list in java. I can't get it. I have been on here - dreaminncode, wikipedia, and some other colleges sites - I still don't/can't get it. I did look at the previous threads on this but they didn't …

Member Avatar for julylee06
0
222
Member Avatar for Jfunch

I have a program that uses two threads, one that adds some numbers and the other takes the sum and finds the average. I used a blocking queue to pass the sum to the other string. I have no problem queue.put() to put the total in the queue and then …

Member Avatar for JamesCherrill
0
220
Member Avatar for bokz06

i have created an app which reads lines from a .txt file, splits the line at a " " and then stores them in a ArrayList which then gets put in a JTable. i created 27 columns and named them... now i want to add an extra column on the …

Member Avatar for Ezzaral
0
670
Member Avatar for vbmore

Hi friends, I am a very new user of this forum and want a simplest program on insertion sort. Can anybody provide me this?

Member Avatar for peter_budo
-1
241
Member Avatar for sirlink99

I am making hearts, and I cannot seem to add all the cards to the deck. here is my code [CODE] import java.lang.reflect.Array; import java.util.Vector; public class Hearts { String cards[][] = {{"Spade ", "Heart ", "Club ", "Diamond "}, {"A","2","3","4","5","6","7","8","9","10","J","Q","K"}}; Vector <String> deck = new Vector<String> (); String player1[] …

Member Avatar for sirlink99
0
121
Member Avatar for Forte1292

Okay so we are doing a BankAccount program in my CS class. One method is supposed to return the information like this - Account Name: <name here> Account Number: <number here> Account Balance: <balance here> The instructions say to return it on multiple lines using the \n command. How do …

Member Avatar for Forte1292
0
125
Member Avatar for mohamed moamen

[CODE] float i = 55 ; float y = 23 ; float u = i / y ; System.out.println(u); [/CODE] i want to print u Round to five decimal places how i can do this approximation ?

Member Avatar for mohamed moamen
0
119
Member Avatar for techyworld

Can someone dry run and explain me this code? having problem to understand recursion program. [CODE] public class Multiplication { public static void main(String[] args) { System.out.println("Answer:"+Mult(2,3)); } public static int Mult(int x,int y) { if (y==1) return x; else return x + Mult(x,y-1); } }[/CODE]

Member Avatar for techyworld
0
87
Member Avatar for drogba123

Hi, I know matrix 2d can be written like array[5][5] which saying 5x5 matrix but how do i make the row is like sequence of alphabets so its like array[a...z][5] while the column still numbers. Thanks.

Member Avatar for drogba123
0
118
Member Avatar for jeffreymummey

I need to build a gui application for Nim. I started writing the code and need help. Will you help me write the Nim game? import javax.swing.JOptionPane; public class Nim { public static void main( String args[] ) { String firstNumber; String secondNumber; int number1; int number2; int sum; firstNumber …

Member Avatar for pluspluss
0
107
Member Avatar for ~s.o.s~

[URL="http://www.youtube.com/watch?v=b-Cr0EWwaTk&feature=player_embedded#!"]An Oracle produced song to promote Java; fun stuff[/URL]. ;-) Lyrics at: [url]http://www.adam-bien.com/roller/abien/entry/code_hard_with_java[/url]

Member Avatar for Netcode
0
129
Member Avatar for b.netana

[CODE]import java.util.Arrays; import java.util.Comparator; public class CameraInventory2 { // The main entry public static void main(String[] args) { // create the array Camera[] camera = new Camera[3]; Cam cam = new Cam(); camera[0] = new Camera(1, "Nokia", 20, 30.0, 8); camera[1] = new Camera(2, "Polaroid", 10, 21.0, 14.1); camera[2] = …

Member Avatar for hfx642
0
284
Member Avatar for teo236

hello i'm trying to draw a kind of arrow with an specific thickness. i've already this: [CODE] public void paintComponent(Graphics g){ super.paintIcon(comp, g, width, height); for(int i=0;i<thickness;i++){ Polygon arrow=new Polygon(); arrow.addPoint(7*scale, 0*scale+i); arrow.addPoint(14*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 9*scale-i); arrow.addPoint(10*scale-i, 29*scale-i); arrow.addPoint(4*scale+i, 29*scale-i); arrow.addPoint(4*scale+i, 9*scale-i); arrow.addPoint(0*scale+i, 9*scale-i); g.drawPolygon(arrow); } g.setColor(Color.BLUE); Polygon arrow=new Polygon(); …

Member Avatar for hfx642
0
125
Member Avatar for esy928

Hello! Im a java noob and I need to create a program that determines whether the input is an integer or not , can anyone help me out? thanks in advance! btw I have to use [B]Scanner [/B] from [B]java.util.[/B] , I have no idea on how to check if …

Member Avatar for abors
0
634

The End.