32,204 Topics

Member Avatar for
Member Avatar for Shotty

hey i'm trying to do my homework for a computer science class, and im a bit stuck. When i run the program, the terminal window doesn't even show up, can anyone help me please. Thanks in advance. class: [CODE]public class Grid { public Grid() { rows = 10; columns = …

Member Avatar for javaAddict
0
131
Member Avatar for Afupi

Ok what I have currently is the blelow code in a for loop and this works fine it just doesn't format the text. [CODE] outString = outString + " " + i + " " + numArray[i] + "\n";[/CODE] I am trying to format the text of i to right …

Member Avatar for Afupi
0
245
Member Avatar for JimD C++ Newb

Good evening, everyone! I'm currently writing a game for a class, and I'm attempting to add a few extra features that aren't required. The one that is giving me difficulty is the high scores. I am saving the score and the name as a string. When a game ends, it …

Member Avatar for JimD C++ Newb
0
129
Member Avatar for Stefano Mtangoo

Hi all, please help me connecting exit menu to OnExit event handler Here is what I have coded so far! Also a coding question: What is the best method between these two: 1. Creating instance of JFrame and call its methods like set Size 2. create class that extends JFrame …

Member Avatar for masijade
0
122
Member Avatar for sciwizeh

Hello all, As you may know by now, from my previous posts recently, I am working on a Paint application. My question, then, surprisingly does not involve Graphics or Swing. So my question is this: I would like to be able to have a directory such as "APP_HOME\tools" or something …

Member Avatar for sciwizeh
1
131
Member Avatar for Neela.V

Hi I need to download a file from a http server which askes for user id and password to login. can someone help me out in downloading the file and place that in a database table. Thanks in advance Neela.V

Member Avatar for masijade
0
138
Member Avatar for samoo

hi everyone i have a problem in my project that i have made pleaze help!!!!! this project allows the user to read words and their meanings from file and store them in AVL tree and then print the tree inorder, postorder, and preorder then print the result to file in …

Member Avatar for javaAddict
0
1K
Member Avatar for Kreators

Hi i'm new here in daniweb i would like to ask about my program i'll make a program that show if the word is palindrome or not can you correct my program when i complie my program its say Process complete then when i run the program it doesn't show …

Member Avatar for P00dle
0
92
Member Avatar for rukshilag

please help with the following 1) i have created a simple java software using netbeans and want to finalize it by making a setup for it or a software that can be used like offered on the web. all i know is to use it as the netbeans project folder, …

Member Avatar for masijade
0
103
Member Avatar for ki72

I'm trying to To create a Student object, the class constructor takes two arguments: a student ID (as a String) and a student name (as a String). I need to add courses to the student record, I need to use the method setCourseGrade. I need to retrieve the grade of …

Member Avatar for masijade
0
108
Member Avatar for cdt1983

Hi- I want to use a sentinel value (-1) to end the loop of a program after the user has entered all of their data. However, how can I output inbetween each instance of the loop? Then, at the end, how can I will have an average of all entered …

Member Avatar for cactuspancake
0
186
Member Avatar for weylinthedirty

I am writing an application for class. The user is prompted to enter a number, then select what to do what that number. I'm using JPanel and JOptionpane for input and console for output. The application is supposed to: prompt for input, ask for what to do with the input, …

Member Avatar for weylinthedirty
0
197
Member Avatar for subhankar02dey

How can I get this output by running a for loop the logic is that after the multiples of 2, "This" will b printed, after the multiples of 3, "Is" will b printed and after the multiples of 5, "Java" will b printed. pls help with code 1 2 This …

Member Avatar for tjsail
0
137
Member Avatar for flashninja

Currently I am trying to read from a file using java and it is just producing errors. I need help with this as I have been unable to fix this myself and have come to a wall with this. Could you just take a quick glance over this and see …

Member Avatar for BestJewSinceJC
0
72
Member Avatar for hallinan

Hi I have a project where when you input text into a textarea if a certain word is put in I need to change this word I'm having real trouble with this Here Is what I have so far but it will not reconize some of the words [CODE]/* import …

Member Avatar for hallinan
0
85
Member Avatar for Moonrise_state

Hi, In a terminal program I'm writing values are inputted and stored in a pair of arrays. At one point in the program I need to print them back out. My problem is that if I input 1.10, Java gives me 1.1. I really need it to print the zero …

Member Avatar for Moonrise_state
0
86
Member Avatar for panagos

Hello, i have to do a project that presents a form with 3 text fields like this [img]http://i47.tinypic.com/1jsw44.jpg[/img] type 2 numbers and then the symbol(+,/,*,-) and do the appropriate action. I am using [B][U]Tomcat 6.0.[/U][/B] I've done so far: [B][U]#[COLOR="Red"]simple.html[/COLOR][/U][/B] [CODE]<html> <body> <form method="post" action="simple.jsp"> Number_1<br> <input type="text" name="value1"><p> Number_2<br> …

Member Avatar for panagos
0
133
Member Avatar for Web_Sailor

Hi, I am struggling with a Layout problem. Here is the definition of the problem:- 1) I have a JFrame where I specify space alignment in GroupLayout for JScrollPane as per the other (JButton/ comboBox etc..). My JScrollPane contains a JTable. I use get and set methods to set scrollpane …

Member Avatar for Perveance
0
182
Member Avatar for Sth

I'm trying to make a valid 9 X 9 sudoku set. I tried it by making blocks of 3X3 and checking for the rules of sudoku on the way as i made other blocks. The code works for like 4 blocks(sometimes 1) and then it freezes. Need help. [CODE]import java.util.Random; …

0
34
Member Avatar for aBenjamin

this is a small example that, i hope reflects the larger project that i am working on. i am making a board game that uses a combination of mouse listener and jbutton action listener for the player to move. when it is time for the computer to take its turn, …

Member Avatar for Ezzaral
0
2K
Member Avatar for Xav123

Hey. I have been trying to do a drafts board, but i am having major problems with adding the pieces. Heres my Board. Any Suggestions?? [code] import java.awt.*; import javax.swing.*; public class Board { protected JPanel[][] squares; protected JFrame boardFrame; protected Container container; public void paint (Graphics g) { } …

Member Avatar for .11
0
97
Member Avatar for mrnutty

I use netbeans but was wondering if anyone knew how to add a Java compiler to visual studio 2008?

Member Avatar for mrnutty
0
147
Member Avatar for Pd123

Hey. Im having problems adding my Jmenubar to my board. It compiles fine just wont display. Any advice really appreciated. Thanks, Pd [CODE] import java.awt.*; import javax.swing.*; import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.awt.event.ActionEvent; import java.awt.Font; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextField; import …

Member Avatar for .11
0
589
Member Avatar for proj

Cud u pls pls help in writing a java code to find execution time of application programs like word???

Member Avatar for zortec
0
101
Member Avatar for _dragonwolf_

I'm trying to create a boggle game. I have it so it will setup the board and accept user input. What I am trying to do now is get rid of the "[" braces "]" and the commas to give it a cleaner look and to hopefully make it easier …

Member Avatar for ~s.o.s~
0
109
Member Avatar for nlanka

public class Average { private double [] Score; int index; public Average(double [] s) { Score = new double[s.length]; for(index=0; index<s.length; index++) { if(Score[index]>100 && Score[index]<0) Score[index]=s[index]; } } public double getAverage() { double total=0.0; double average = 0.0; for(double value: Score) total+=value; average= Score.length/total; return average; } } the …

Member Avatar for javaAddict
0
104
Member Avatar for COKEDUDE

Can someone please tell me why "int can not be dereferenced" here. contents += cart[i].toString() + "\n [CODE]// ********************************************************************** // ShoppingCart.java // // Represents a shopping cart as an array of items // ********************************************************************** import java.text.NumberFormat; public class ShoppingCart { private int itemCount; // total number of items in the …

Member Avatar for javaAddict
0
200
Member Avatar for Druyx

Hi Daniweb I'm not really new, I've been lurking on the site for a while now, and I've suddenly felt the urge to start contributing. Of course I need to actually have something worth while to contribute.... Anyway, I'm java and C++ programmer (depending on what I'm working on) and …

Member Avatar for Doctor Inferno
0
174
Member Avatar for LucarioWill

[CODE]import java.util.Scanner; public class MathTutor { Scanner input = new Scanner(System.in); int numQuestions; int choice; int numCorrect; public MathTutor (){ numQuestions = choice = numCorrect = 0; } public int getNumQuestions(){ { System.out.print("How many questions? "); numQuestions = input.nextInt(); if (numQuestions < 1) { System.out.println("Invalid - must ask at least …

Member Avatar for LucarioWill
0
3K
Member Avatar for Clawsy

Hi, I first convert the image on the server application in bytes: [code] //server public void sendImage(File file) throws IOException { ByteArrayOutputStream baos=new ByteArrayOutputStream(1000); BufferedImage img=ImageIO.read(new File(file.getAbsolutePath())); ImageIO.write(img, "jpg", baos); baos.flush(); os.write(baos.toByteArray());// this is a "new DataOutputStream(clientSocket.getOutputStream());" System.out.println("Done! Length is:"+baos.toByteArray().length); baos.close(); } [/code] Then my application freezes when trying to …

Member Avatar for Clawsy
0
219

The End.