32,199 Topics

Member Avatar for
Member Avatar for sike.mausa

[B]I have been given a chunk of code from my teachers, and I just need help getting it to run. I'm very new to java so any help is much appreciated. Here it is:[/B] [code] import java.util.*; import java.io.*; public class CourseStats { static String[ ] studentNames; static int[ ][ …

Member Avatar for sike.mausa
0
612
Member Avatar for limpek1991

Hi there. This is actually one of my assignment and i am having problem with the do while sentinel looping. The result i get is totally inverse from the one i expected. The system is supposingly ended when user enter 0, but it ended when user enter any value but …

Member Avatar for limpek1991
1
123
Member Avatar for subone

Hi, I am making a program where the user has to input an integer with LESS than 5 digits. If he enters more than 5 digits, I want the program to print: "ERROR" How can I do that? I wrote this code till now. Do I have to use a …

Member Avatar for JamesCherrill
0
3K
Member Avatar for <HHH>

hello ! im trying to read few numbers from a file and but each line of numbers in diffrent array now i can read the numbers but in one array any help here is the code [CODE] public static void main(String[] args) throws IOException { File number = new File …

Member Avatar for <HHH>
0
103
Member Avatar for shady05

i am creating an audio Player . I just wanted to implement this particular iTunes software feature i.e COVER FLOW , in which songs appears in thumbNails and with the help of left & right arrow keys we could scroll the playlist I was wondering if anyone could help me …

Member Avatar for shady05
0
124
Member Avatar for BuhRock

So I have to program this MVC GUI of a checkout line. I have a gui that has 10 registers. Each register has a queue of customers. There is a button that when clicked, will generate a customer and the customer will be entered in the line with the shorted …

Member Avatar for JamesCherrill
0
211
Member Avatar for StephNicolaou

Hey guys, I have an Jlabel class and trying to simply add it to the panel in my main class. However is nowhere to be seen! No errors are being output so currently have no idea what wrong...unless you can see whether my method is wrong... Jlabel class: [code] public …

Member Avatar for StephNicolaou
0
232
Member Avatar for sajithdil

Hi guys I have written a class that uses a frame and Swing components. Unfortunately the traversal policy that i wrote does not seem to work for the jmenu. Can u guys help me fox it....much appreciated [code] public class MainFrame extends JFrame { //<editor-fold defaultstate="collapsed" desc="Variables"> JMenuBar jmb = …

0
87
Member Avatar for angeriel1

I have the folowing code so far which outputs the make and price of a car,but i cant seem to figure out were to add the discritpion of the car so that it can also be diplayed.HELP! i tried adding discription[k] = st.nextToken(); but the program did not run. [ICODE]import …

Member Avatar for mKorbel
0
206
Member Avatar for tenlrt

Hi, An urgent help is required. I need to display colored font in command prompt during execution of a java program on Windows Machine. I am unable to do so and while I searched for online help I came across JANSI library. Is there any other simpler and better way …

Member Avatar for Slimmy
0
130
Member Avatar for codybuRr

Hey All! New to here, but I have a couple questions: How do I find Average word length, and how to I printout the occurrence of each word size? Needs to look like this: [CODE]length frequency ------ --------- 1 3 2 13 3 24 4 13 5 10 6 2 …

Member Avatar for codybuRr
0
1K
Member Avatar for siva28

Can you please tell us, free gold and silver rate service provider for RSS . And also give whether casting service provider RSS feed.. need java script above mentioned or XML file.

-1
82
Member Avatar for TigerTeck

Directions...Write a program SumOfOdds that has one main method that asks the user to input two odd integers where the first is smaller than the second. The program ouputs the sum of all the odd integers from the smaller output to the larger output. You must use a while loop …

Member Avatar for TigerTeck
0
113
Member Avatar for Nandomo

I am writing a program that gives and grades a test. Currently I am working on reading in the text from a file to administer the test, but am running into limitations. So I have a couple of questions. Is there any way I can read in a segment of …

Member Avatar for Nandomo
0
198
Member Avatar for Nandomo

I made an arraylist of objects which contain a question and an answer... How can I display just the question? Sooooo confused. Tutorials or anything will help, thanks in advance. [CODE] /* text file */ T Which Java keyword is used to define a subclass? extends S What is the …

Member Avatar for Nandomo
0
180
Member Avatar for akaicewolf

Ok so I am writing this GUI menu and one of the choices on the menu requires the user to log in. So I open a new window that prompts the user for a username password. However after the user inputs the information how do I just close the window? …

Member Avatar for hfx642
0
296
Member Avatar for federerforehand

[ICODE]import java.util.Random; public class Card { public String cardGeneration() { Random generator = new Random(); int x; // random integer representing suit int y; // random integer for card value String mysuit, mynumber; //assigning names, these will be changed int suits = 4, numbers = 13; //depending what card is …

Member Avatar for hfx642
0
200
Member Avatar for lele07060

can someone help me and tell me what is wrong, I can't figure it out. This is what it is exactly saying Lab424.java:14: cannot find symbol symbol : method printf(java.lang.String, float) location: class Lab424 printf(" sum %f\n", sum); it is pointing to the "p" [CODE]import java.util.Scanner; public class Lab424 { …

Member Avatar for JamesCherrill
0
522
Member Avatar for eLu-sive

hi, am working on a bigger project than this, only using this as an example because i do not want to waste a lot of your time. i have this code, its supposed to write to the database, but have no idea as to what i should put under action= …

0
87
Member Avatar for skywire_

Hello, I was tasked to make a program that reads data from a text file and then place it into a JTable. I managed to read the file and split the strings but I don't know how to put the strings into a format accepted by JTable. Please help. This …

Member Avatar for mKorbel
0
2K
Member Avatar for domingur

This is my project and I have the code below.....Create a class that simulates the functionality of a simple car. You can do simple things like drive, add gas and honk the horn. Simple text messages are displayed on the screen for feedback when appropriate and ALWAYS include the make …

Member Avatar for JeffGrigg
0
712
Member Avatar for Erlendftw

Is there an actionMap-like thing for mouse clicks? Thank you in advance, ive tried google, but did not find anything :/

Member Avatar for Erlendftw
0
207
Member Avatar for jjemphoung

I am currently doing some writings to an excel file (.xls) through JExcel API. My problem is about the autoSize method of CellView. My code. [CODE] public void write() throws IOException, WriteException { File file = new File(inputFile); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, …

0
157
Member Avatar for lele07060

can someone help me and tell me what is wrong, I can't figure it out. It is pointing to the line "public class Lab4.24" [CODE]import java.util.Scanner; public class Lab4.24 { public static void main(String[] args) { int i; float sum; i=3; sum=0; while(i<=99) { sum=sum + ( (i-2)/i); i=i+2; } …

Member Avatar for JeffGrigg
0
80
Member Avatar for sha11e

I downloaded mysql-connector-java-5.1.18 and put it on my USB drive. I brought my USB drive to school and opened up Eclipse, in there I added an external .jar (the mysql-connector-java-5.1.18.jar). Then I wrote this java code: [CODE] import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Scanner; public class Main …

Member Avatar for ~s.o.s~
0
208
Member Avatar for spades0001

Hey guys! I'm trying to make a GUI program. The program can take a picture from the computer, then the user can tag certain areas and input names. When the user hovers over the area where he/she tagged, it would show the name of the person tagged. And also, the …

Member Avatar for JamesCherrill
0
99
Member Avatar for 54uydf

Hi, I'm seriously guessing here, but since I've seen that some php websites contain java stuff, like a java chatroom, I wonder if I can find a better solution adding some java to my php code. I'm looking for a way to browse and select a folder, or allow the …

Member Avatar for 54uydf
0
176
Member Avatar for slasherpunk

So I know of two methods of reading or writing files in java. The first is the read(byte[]) method provided by InputStream class. The second is the readLine or write() method provide by the Buffered prototype. Which is the more efficient one out of these? Which one would you recommend?

Member Avatar for JamesCherrill
0
153
Member Avatar for ITHope

So my java pprgram is actually a GUI I did all of it except I cant figure out how to convert between bases example: number=2239 base=3 newbase=4 first i need to convert 2239 to base 3 which would be 2 * 3^3 + 2* 3^2 + ..... then convert that …

Member Avatar for JeffGrigg
0
111
Member Avatar for asmsycool

Hi, i've a problem with my codes, when ever i run it, i got an error from the checking i implemented. Can some pls explain why does the error keep coming. [CODE]import java.net.*; import java.io.*; public class EchoClient{ static final int serverPort = 1026; static final int packetSize = 1024; …

Member Avatar for JamesCherrill
0
442

The End.