32,199 Topics

Member Avatar for
Member Avatar for laklaker

Hi everyone! Here's my problem. I created a random guesser game (A school project) and then my instructor said they want them to put a hall of fame on the game. But... The problem is how do i put a hall of fame? If its saving 1 line per file. …

Member Avatar for JamesCherrill
0
456
Member Avatar for y0ge5h

how can I write a program for a calculator the methods of cookie ? Provide facility for additon,substraction,multiplication,division in that calculator? thank you..

Member Avatar for hiddepolen
0
75
Member Avatar for arathy nair

Hi Friends, I am having a pdf which has to be watermarked.But the code below I use is writing contents of my PDF into another PDf which is being watermarked.Please suggest any ideas which helps me watermark the same pdf without creating a new one. Please find the code below. …

Member Avatar for peter_budo
0
167
Member Avatar for nsafi17

Can someone explain how I would go about checking that the new valid word entered is only one character different from previous word???

Member Avatar for stultuske
0
144
Member Avatar for jackbauer24
Member Avatar for DavidKroukamp
0
131
Member Avatar for jimJohnson

I am just hoping to possibly get some feedback from someone. I recently graduated college with my CIS degree and right now I am going through this book Murach's Java SE 6. If any one is the slightest familar with this book could you let me know if after mastering …

Member Avatar for stultuske
0
231
Member Avatar for dineshswamy

dont know the why this modified JTextField did not show up..help me out [CODE] import java.awt.*; import javax.swing.*; public class JBgtextfield extends JTextArea{ public void paint(Graphics g) { setOpaque(false); ImageIcon ic=new ImageIcon("image1.png"); Image i=ic.getImage(); g.drawImage(i,0,0,this); super.paint(g); } } [/CODE] i then created an instance of this class and added it …

Member Avatar for JamesCherrill
0
162
Member Avatar for FUTURECompEng

Code attached in the attachment is not my own and was supplied by an instructor. I am to create a word morphing game. The computer will provide a starting word and an ending word. I am to enter a new word, that either adds or removes a letter from the …

Member Avatar for JamesCherrill
0
918
Member Avatar for jmace

When I try to output an ASCII value to a file, it sometimes writes the wrong value. Example: [CODE] import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.PrintWriter; public class test { public static void main(String args[]){ //Supposed to: writeFile("./test.txt"); //write ASCII 147 readFile("./test.txt"); //read ASCII 147 } public …

Member Avatar for JamesCherrill
0
3K
Member Avatar for Traps

Would it be possible to use JavaScript with C# (or Java, Python etc) for the sake of getting a sweet UI. Say for example I have a program written in C# with a ok-looking GUI which holds some panels, a few buttons, radiobuttons, the usual stuff. Would I then be …

Member Avatar for Traps
0
125
Member Avatar for Thermalnuke

Hey I am having a problem with this java program im trying to accomplish.... I know how to count the characters or letters in a word, but how do you count every other word and display that letter in a row. Im trying to do an encryption program for example …

Member Avatar for Thermalnuke
0
135
Member Avatar for SasseMan

Hi! I have a JScrollPane that contains a JPanel with a CardLayout, which in turn contains two JPanels with some labels and stuff. I want the contents of the ScrollPane/ViewPort to never exceed the width of the viewport. The problem I'm having is that when a label holds a lot …

Member Avatar for mKorbel
1
179
Member Avatar for sha11e

My client-server program seemed to work fine, I could send and receive messages. But if I don't send any messages for a while (sometimes 2 minutes is enough, other times it takes an hour..) and then try to send one, I get the error "Software caused connection abort: recv failed" …

Member Avatar for sha11e
0
301
Member Avatar for srikanth2321

Hi all, I'm currently using SAX to parse an xml file. Recenlty I have encountered a problem where, one of the element consist of more than 50,000 characters (a DNA sequence ) and the SAX results nothing as an output. The code which I'm using is [CODE] public void getCommand() …

Member Avatar for srikanth2321
0
377
Member Avatar for bloodbender

Hello Daniweb, What would you guys say is the most effective way to manage memory for powers? I'm thinking for smaller powers, like squares or something, it's probably just better to do x * x and Math.pow(x, 2) should only be used for bigger powers. I have a lot of …

Member Avatar for bloodbender
0
104
Member Avatar for ghada ali

I have a code for speech recognition but it not work good it has a problem in line 31 what is the solution ??? [code] import edu.cmu.sphinx.frontend.util.Microphone; import edu.cmu.sphinx.recognizer.Recognizer; import edu.cmu.sphinx.result.Result; import edu.cmu.sphinx.util.props.ConfigurationManager; import edu.cmu.sphinx.util.props.PropertyException; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; public class HelloWorld …

Member Avatar for ghada ali
0
350
Member Avatar for dineshswamy

I dont understand why we are using super.paint() in this code. help me to figure out why? [CODE] public class SetJTextFieldBackgroundImage extends JTextField { public SetJTextFieldBackgroundImage() { JFrame frame=new JFrame("Set JTextField background image"); frame.add(this); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300,65); frame.setLocationRelativeTo(null); frame.setResizable(false); frame.setVisible(true); } public void paint(Graphics g) { setOpaque(false); //Image that will be …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Goldfinch

Hi, I'm trying to understand a java concept, I'm trying to get a piece of code to work without changing the main method. [CODE=java] public class TestProg2{ public static void main(String args[]){ String filler1="Rank"; String filler2="Suit"; Card card = new Card(); System.out.println(card); } } class Card{ public String Card(){ String …

Member Avatar for DavidKroukamp
0
130
Member Avatar for ThaiAmL

Writing an abstract class for homework - here's what I have so far: [CODE]public abstract class Pet { String petName; double foodAmount; double foodSupply; int days; public Pet(String petName, double foodSupply) { //constructor to be used by sub-classes this.petName = petName; this.foodSupply = foodSupply; } public Pet() {//default constructor } …

Member Avatar for stultuske
0
707
Member Avatar for christian03

please tell me step by step procedure to how to delete the thread that i post ?? please help me guys.

Member Avatar for happygeek
0
151
Member Avatar for hust921

Hey i know this is a stupid question, but i have no idia how to google it. I have copied this code directly from a book: Btw, my main() method is empty. [CODE] package benytterning; public class Terning { public int værdi; public Terning() { kast(); } public void kast() …

Member Avatar for zeroliken
0
134
Member Avatar for 3nrichedd

I am working on this assignment in my java class, and am running into a few problems. Basically there are 2 classes and a main/client program that tests the classes. there is 1 superclass and a subclass that extends the superclass.. I have 2 constructors in my superclass but when …

Member Avatar for hiddepolen
0
251
Member Avatar for warlord902

I never worked in any company or organization, so you people can guess I do not have much idea. I am working on a quite big project of a website alone using Java/J2ee. As I am working alone so I am working on all the things at a time. Sometimes …

Member Avatar for peter_budo
0
234
Member Avatar for bo0ga

I have an option to take an independent study next semester related to websites. I basically teach myself a programming language of my choice for the semester, and do a project for my professor at the end. He suggested either advanced java or php. I asked him which would help …

Member Avatar for Mehmaan
0
300
Member Avatar for monica86

I am very new to this and the computer programming world in general, and I'm having a problem with my program and I think I'm just making one little mistake, but I can't figure out what it is! I'm using class GetStats to be the main for my other class …

Member Avatar for stultuske
0
7K
Member Avatar for MBPB

Hi all. I am learning Java, and having a problem with a sentinel loop to fill an array. I want the loop to terminate when -1 is added, OR when the array is filled. [CODE] int i = 0; int counter = 0; int[] array = new int[40]; System.out.print("Enter values …

Member Avatar for DavidKroukamp
0
3K
Member Avatar for scheppy

Ok, so I have my code for the timer [CODE] computer = new Timer (4000, this); computer.start (); [/CODE] The timer starts at the end of a method, and is supposed to start another method via actionlistener after 4 seconds, the problem is, after 4 seconds, the timer gives a …

Member Avatar for DavidKroukamp
0
186
Member Avatar for miss_lovely

Write a class that accepts a user's hourly rate of pay and number of hours worked. Display the user's gross pay, the withholding tax (15% of gross pay) and the net pay, (gross pay - withholding) I have my code below, but I'm lost. I dont know what I'm doing …

Member Avatar for DavidKroukamp
0
2K
Member Avatar for scheppy

ok so I have a JButton that has an image on it, and then after 4 seconds i want to put a differant image on it but the problem is the first image wont load I'm using [CODE] button1.setIcon (icon); try { Thread.sleep (4000); //sleeping for 4 seconds } catch …

Member Avatar for scheppy
0
171
Member Avatar for brandon66

This is what i am suppossed to do: Create an application that will ask the user for a number between 1 and 10 and then output the factorial of that number. Use a for loop to calculate the factorial. What is a factorial? A factorial is the product of all …

Member Avatar for brandon66
0
152

The End.