32,199 Topics
| |
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 … | |
| |
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 … | |
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 … | |
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] … | |
| 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()); … |
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 … | |
| 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); … |
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 … | |
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? | |
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. | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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", "* *","* *","* *", "* *", "* *","*", "* *","* *","* *","* … | |
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() … | |
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!! | |
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 | |
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 … | |
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 … | |
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 … | |
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 ? | |
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. */ … | |
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(); } … | |
can anyone tell me how to get out of the error Connection refused: connect thanks in advance | |
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 … |
The End.