32,204 Topics

Member Avatar for
Member Avatar for bhallarahul
Member Avatar for bhallarahul
0
103
Member Avatar for bsabowala

String line = null; double value; BufferedReader in = new BufferedReader(new FileReader("C:\\Users\\Bilal\\Documents\\Work\\scrambler\\input.txt")); int x=0; while (line != "end"){ line = in.readLine(); System.out.println(line); x++; } }} When I run this.. the loop does not stop when the word end comes.. why???????

Member Avatar for JamesCherrill
0
187
Member Avatar for choosenalpha

Hi All, I'm fairly new to Java. I have a question involving the Replace Method. Is there, any way I can use the replace method to change a string that results in: Helle, Werld; to get it to result to Hello, World using the replace method. I have seen the …

Member Avatar for TrustyTony
0
220
Member Avatar for Baduizm

Why do I get a Null Pointer in my test whenever I run it from the ant?My Test class Is: package com.MySelf.exchangerate.exchange; import static org.junit.Assert.assertEquals; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import junit.framework.Test; import com.MySelf.exchangerate.application.ExchangeRateApplication; import junit.framework.TestSuite; public class ExchangeRateApplicationTestCase extends AbstractTestCase{ public static final Logger logger=Logger.getLogger(ExchangeRateApplicationTestCase.class); private static final double delta …

Member Avatar for Baduizm
0
163
Member Avatar for coding101

im trying to build my own LL, not seeming to work? My insert method is wrong, and cant fiugre it out, any ideas? public class List { private int size; private Node root; private Node current; public List(){ size = 0; } public void insert(int a){ size++; if(root == null){ …

Member Avatar for NormR1
0
99
Member Avatar for Hypnos_16

Hey everyone, i'm currently working on a program that requires a number to be saved outside of the program in some manner and recalled later. Sounds confusing but perhaps this will help. The program i'm making is a game, and i want to be able to create something similar to …

Member Avatar for 117
0
167
Member Avatar for mags11

Hello. I am having a slight problem with layout in my program. The Textfield doesn't seem to be aligned with the Message Label. The program is a GUI MPG calculator. It's supposed to calculate the car's mileage. It's supposed to let the user enter the number of gallons of gas …

Member Avatar for NormR1
0
736
Member Avatar for Stevo812

Hi everybody. I am new to this site and am sure you guys could help me. I am currently writing a pool game using eclipse and need to create an array of objects.I have two balls placed individually onto the screen but I'm not certain how to write an array …

Member Avatar for Stevo812
0
1K
Member Avatar for Mr.BunyRabit

I have a java program whith a mysql database. the user loggs in in the breginning of the system with a username and password. there are some functions that the normal users may not see/use. How do i know who is logged on to my system, since they only type …

Member Avatar for gourav1
0
278
Member Avatar for mkerala

A program to solve the following problem. You can use C, C++, C#, Java or Haskell to code your solution. **The problem** You have a block of platinum that can be exchanged in your bank either for cash or for smaller blocks of platinum. If you exchange a block of …

Member Avatar for thines01
0
1K
Member Avatar for jackbauer24

When I run my bucky.java, the background color is black and not pink. Why? Here is my bucky.java:- import javax.swing.*; import java.awt.*; /** * Created by IntelliJ IDEA. * User: Administrator * Date: 3/30/12 * Time: 3:59 PM * To change this template use File | Settings | File Templates. …

Member Avatar for jackbauer24
0
178
Member Avatar for idlackage

I put a bunch of JButtons in a 2D array into a GridLayout. I want the user to be able to change the size of this grid at run time, but I tried resetting the row/cols, re-adding the buttons, remaking the panel that this grid is in - all to …

Member Avatar for idlackage
0
498
Member Avatar for froggyking

I'm supposed to ask the user for a grade and store that grade for future use and add curves. How do I store the grade and send it to the different methods in the switch statement? Thank you for checking out my question! import java.util.Scanner; // Used for keyboard input …

Member Avatar for NormR1
0
114
Member Avatar for Stevo812

Hi all. I'm currently writing a pool game in java and I'm having trouble making the cue ball move by using the mousePressed(), mouseDragged and mouseReleased() methods of mouseEvents(). When the mouse is dragged a line should appear out of the ball in opposite directions one for the power and …

Member Avatar for NormR1
1
1K
Member Avatar for Syrne

Hi guys, I am toying around with ArrayLists and objects and I created a quick program to add some objects to an ArrayList and print the list afterwards. I ran into an issue, though. I am overriding the toString method in order to display the names of the objects I …

Member Avatar for Syrne
0
157
Member Avatar for CodeMonkeyJunk

This is the criteria i am required to get my program to do. I have looked on google for help but I can't find any. Enhance / modify the program you created in the previous assignment. Create a class ScanArray. This class should have two methods FindMax and FindMin. Class …

Member Avatar for CodeMonkeyJunk
0
412
Member Avatar for Mr.BunyRabit

hey there. (i first posted this question on the wrong forum... idiot.. i know) I want to change the looks of my buttons in netbeans (6.9.1) But when ever i try (when i go to the properties -> icon -> and try to select the images, ONLY a few of …

Member Avatar for Mr.BunyRabit
0
474
Member Avatar for Mr.BunyRabit

Hey there i have a problem with a program that works on other pc's but not on my laptop. (it connects to access) When i try to run it it gives me the error "AAAjava.sql.SQLException:[Microsoft][ODBC Driver Manager] data source name not found and no default driver specified" I already reinstalled …

Member Avatar for Mr.BunyRabit
0
207
Member Avatar for Mr.BunyRabit

Hey there I started coding again on my old project in netbeans but i have no idea what kind of a prject it is, for example, is it javaEE or whatever. like in the image attached. How can i find out what my current project type is? Thanx

Member Avatar for Mr.BunyRabit
0
105
Member Avatar for Mr.BunyRabit

Hey there. Whyy is my netbeans so retarted?! is this a common problem? or is it just with me? Ive attatched two images to show you what it does to my buttons. image one is the actualy program running image two is in the design view Thanx

Member Avatar for Mr.BunyRabit
0
99
Member Avatar for 3nrichedd

hello everyone, I am recieving this compiler error stating that `else if(input%100 || input%10 == rndNum%100 || rndNum%10)` this line ^ gives me the error error: bad operand types for binary operator '||' was hoping someone could explain this error to me if possible, also any advice would be greatly …

Member Avatar for picogenkaku
0
168
Member Avatar for ringo_tech

Hi everbody, in the server side of my project,when i close the socket then try to open it again the following exception is thrown java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind how to solve this without close the whole pogram to enable a client to reconnect to the server?

Member Avatar for ringo_tech
0
177
Member Avatar for DoubleGee

Hello guys, I'm fairly new to Java. I have been asked to create a simple GUI (JLabel, JTextField and 3 JButtons) I have managed to create the GUI but I'm having trouble with making the buttons work. Here is my actionPerformed method: public void actionPerformed(ActionEvent evt) { if(evt.getSource().equals(printButton)) // This …

Member Avatar for 117
0
201
Member Avatar for tabicat91

Ok, so I'm writing a chat client/server and both the client and server are multithreaded to accept user input and read from the socket at the same time. Since it can do both at the same time, I'm trying to overcome the problem of the user typing in a message, …

Member Avatar for NormR1
0
129
Member Avatar for samc36

# Java Conversion Program # Hi everyone reading this. I appreciate you taking the time to even look at my problem. I'm designing a converter app in Java to convert units, km to ms-1, degrees celsius to fahrenheit etc etc.. I have built a basic Gui using the WindowBuilder plugin …

Member Avatar for samc36
0
335
Member Avatar for MxDev

Hi guys, Today I've passed the SCJA exam, but i was wondering if Oracle will send me a certificate to my address proving that i have passed the exam and i'm offically SCJA holder?? Thanks guys

0
51
Member Avatar for MrHardRock

Hey guys, I recently had an assignment to write a sort algorithm we have not yet gone over in class. I had no problem getting my code written and to compile, but now that it compiles I keep getting an error that says "Exception in thread "main" java.lang.NoSuchMethodError: main" I …

Member Avatar for Ezzaral
0
228
Member Avatar for jarograv

import javax.swing.JOptionPane; public class Login{ public static void main(String[] args){ String username = JOptionPane.showInputDialog("What is the desired username?"); String password = JOptionPane.showInputDialog("What is the desired password?"); boolean unlock=false; while(unlock==false){ String usernameinput = JOptionPane.showInputDialog("What is the username?"); if(username==usernameinput){ String passwordinput = JOptionPane.showInputDialog("What is the password?"); if(passwordinput==password){ System.out.println("access granted"); unlock=true; }else{ System.out.println("denied"); …

Member Avatar for jarograv
0
117
Member Avatar for syed30

Hey guys I need to hand in this assingment and actually made an account for this as I know this is one of the best forums so far that I have came across about programing, so it would be awesome if someone could help me out with this. So first …

Member Avatar for Ezzaral
1
500
Member Avatar for jackbauer24

Hey guys, sorry I didn't post for long. Now here I am, with a new issue. Here is my code:- import java.applet.*; import java.awt.*; import javax.swing.JFrame; public class HelloWorld extends JFrame { public HelloWorld() { setVisible(true); setResizable(false); setSize(300, 300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public void paint (Graphics g) { g.drawString("Hello World!", 50, …

Member Avatar for JamesCherrill
0
271

The End.