32,199 Topics

Member Avatar for
Member Avatar for vmehta91

Trying to teach myself Java, for better or for worse. The program I intend to create should pick a random playing card from a deck of cards, determine the suit and face value, then return all variables as shown: "You picked 14, the 2 of Hearts." The problem is I …

Member Avatar for JamesCherrill
0
935
Member Avatar for yuvaece
Member Avatar for stultuske
0
108
Member Avatar for cyman29

Hey guys im trying to make a user form for my HTML page which asks the User to input a question and by clicking the Submit button I want the page to display the Text (Question Inputted) and the date that the user actually asked the question. This is how …

Member Avatar for syrellNardo
0
180
Member Avatar for AbdullahJava

guys please i need help what method do i need to use for the alphabetical order Is it indexOf if yes how can i use it Problem 2: Alphabetize Three Words Program Name: Alphabetize.java Write a program to take three words as input then output those three words in alphabetical …

Member Avatar for NormR1
0
2K
Member Avatar for Afropuff01

I am trying to make a static scanner outside of the main method that can be accessed by every method in a class. However, every time I run it, I get a "error: unreported exception FileNotFoundException; must be caught or declared to be thrown" error. Here is my code: [CODE] …

Member Avatar for NormR1
0
216
Member Avatar for sonicx2218

There's definitely a way to make a for loop out of variables. So if this button I made is clicked, the program will parse the ints in the textfields and send them to variables num1-num5 [CODE] if (e.getSource() == calc) { num1 = Integer.parseInt(num1field.getText()); num2 = Integer.parseInt(num2field.getText()); num3 = Integer.parseInt(num3field.getText()); …

Member Avatar for sonicx2218
0
74
Member Avatar for MichaelCJ10

Im trying to make an array that just lists out some values, its the number of items sold in a day in a shop. and then, total those items in a seperate printf. Heres my code so far, i also seem to have an issue where it just ignore my …

Member Avatar for MichaelCJ10
0
119
Member Avatar for krejar

This is the code: [CODE]public void testPopulate (int num) { ArrayList<String> great = new ArrayList<String>(); for (int i = 0; i < num; i++) { Random gen = new Random(); int b = 0; b = gen.nextInt(100) + 1; great.add("Account: " + (BASE_ACC_NUM + i)); great.add("Balance: " + b); System.out.println(great); …

Member Avatar for FALL3N
0
98
Member Avatar for FALL3N

hey... I wat to change the... well, the cursor (the little blinking thing in a text area where subsequent typing appears) in a JTextArea. [U]Not[/U] the pointer (the mouse icon showing where on the screen the mouse is cuz some ppl thought that was wat I meant) but the cursor …

Member Avatar for FALL3N
0
1K
Member Avatar for dantinkakkar

I'm currently developing a program that has a lot of different, say, components to it that have to be linked together in some sort of manner. Now, what I wanted to ask is, is it viable to create all of the components as separate executables and access them programmatically?

Member Avatar for JamesCherrill
0
118
Member Avatar for ickyrr

Hey guys, i want to create a card game in java. The game is called Tong-its.,i'm having a really hard time doing it.where do i start?Im wondering if i would use applet or jframe.

Member Avatar for JamesCherrill
0
227
Member Avatar for gatechie

i have a problem that i have been working on. i'm in need of some desperate help for someone can show me how to make this program work. [CODE] import java.util.Scanner; import java.io.*; public class LettersCounter { public static void main(String[] args) throws IOExceptions { //needed for scanner class Scanner …

Member Avatar for dantinkakkar
0
1K
Member Avatar for rizzi143

Create a program to construct a binary search tree consisting of nodes that each stores an integer in Java, avoid duplication of values when inserting nodes in the tree. When a new leaf node is created list all the nodes in the path from the newly added leaf node to …

Member Avatar for ejosiah
0
258
Member Avatar for Eragah

[B]Ok so i have two classes a tester class and a class that has the variable of drawing an ellipse. The program prints out 4 faces with 4 different colors. I want to store the users choice of one of the four choices in an array. Can someone help me …

Member Avatar for thines01
0
311
Member Avatar for Hitman Mania

Hey, I'm almost done my long program that I've been working on all week, but I'm stuck on this tiny problem where I can't seem to add more than one shape component inside a frame at the same time. [CODE]final Rectangle recComp = new Rectangle(); final Ellipse ellipseComp = new …

Member Avatar for ejosiah
0
155
Member Avatar for h0427

Hi, I'm working on a project and I am stuck on the AccountTest.java right at where the program is supposed to process the transaction-code within a while-loop. Below is the pseudocode for that was written for this particular assignment. This is my first post so I hope that I've formated …

Member Avatar for dantinkakkar
0
4K
Member Avatar for Navlag

My code(below) displays only one "message" at a time and then prompts the user to delete the message in order to create a new one. How can I make it so that the user can constantly add new messages without having to delete the previous message? [CODE]import java.security.SecureRandom; import java.util.Iterator; …

Member Avatar for stultuske
0
314
Member Avatar for vince8864

Hi, Here is the challenge for first jsp based project. Originally, i have an authentication.jsp that passes form to authentication java class for username and password matching. Then the java class will redirect to other jsp if it matches. After that, i wanted to solve the logout problem related to …

Member Avatar for anand01
0
131
Member Avatar for rayden150

first i tried with system.out.. then i tried this: [CODE]import javax.swing.*; import java.awt.*; public class Ejer1 { public static void main(String [] args){ JTextArea graphs = new JTextArea(); String [] graph1 = {"*********"}; String [] graph2 = {"%s\n%s\n%s\n%s\n%s\n", "* *","* *","* *", "* *", "* *","*", "* *","* *","* *","* …

Member Avatar for Xeno999
0
187
Member Avatar for TrickyT

hi, all ... very new to java, but plugging along somehow ... however, i have an assignment that wants me to find the value of all of the inventory of a product and i have the entire code, but the method that i created to calculate the value ... calculateTotInvent() …

Member Avatar for TrickyT
0
188
Member Avatar for bivashkumar41

i m working on a project and i want to implement a java code such that if user enters a number say 5 then after submitting on the next frame 5 textboxes should be displayed?? please help me!!

Member Avatar for bivashkumar41
0
116
Member Avatar for dennysimon

hello all how to put more than one JLabel in a vertical direction,and right align by computing the length of each of JLabel.Text so the appearance like below Name: Position: age: thank you denny

Member Avatar for zeroliken
0
69
Member Avatar for bluealein56

I know alot of you guys get the same posts over and over about intro JavaII Classes, but I have tried to refrain from asking something that has already been solved and try learning on my own, but Im stumped. Im having trouble with this program, specifically at my calculation …

Member Avatar for zeroliken
0
810
Member Avatar for knitex

I have recently started using VIM for writing java code so I'm still getting use to the things i can do with it. I'm having trouble compelling the file directly in vim. I would like to have it so i can use :compile to compile the programs and then it …

0
163
Member Avatar for aanders5

How do I clear/renew/empty/refresh a 2D JButton Array? I've tried a lot of things, but all that is happening is the new 2D array, just adds onto the old one, which is not what I want. It won't even just overwrite the old array. So i am not sure what …

Member Avatar for aanders5
0
253
Member Avatar for sj5536

how do i add multiple pane in frame dynamically that is in my frame there is one text box which take value from user when user click on ok button i have to add that much panel in jframe how do i do that ?

Member Avatar for Punit.Shah
0
5K
Member Avatar for nickecarlo

I can't figure out why I get the NullPointerException on Line 223. Would appreciate any help whatsoever. Sorry about the spacing below. Some of the code appears messy. Toggle Plain Text and it should look better. [CODE]/* Section 1: Import Statements. Imports the Scanner class and the IO Package. */ …

Member Avatar for nickecarlo
0
217
Member Avatar for jazzermonty

Hi folks So I'm developing a small game for a homework question. I have 3 classes. Apart from the main class, my drawing class draws on screen the objects for my game, like so.. [CODE] public void bat(Graphics g) { //draw the bat g.setColor(Color.ORANGE); g.fillRect(batX, batY, breadth, batLength); g.getClipBounds(); } …

Member Avatar for jazzermonty
0
96
Member Avatar for adil_bashir

can anyone tell me how to get out of the error Connection refused: connect thanks in advance

Member Avatar for adil_bashir
0
54
Member Avatar for TIM_M_91

Hi Guys well what I am trying to do is set a background image for my program where my labels, buttons , and text areas sit in front of the background. Everything I try I try I cannot get it to work. My jframe layout is below so any help …

Member Avatar for TIM_M_91
0
194

The End.