32,199 Topics
| |
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. … | |
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.. | |
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. … | |
Can someone explain how I would go about checking that the new valid word entered is only one character different from previous word??? | |
Except for GUIs, could anyone give me an example of why we need inner classes? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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" … | |
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() … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 } … | |
please tell me step by step procedure to how to delete the thread that i post ?? please help me guys. | |
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() … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.