Forum: Java Aug 31st, 2009 |
| Replies: 4 Views: 262 Hello,
This is for you.
public class CustomNumberType extends Number{
public double doubleValue() {
return 0;
} |
Forum: Java Jun 15th, 2009 |
| Replies: 6 Views: 600 Well, Im not sure what you meant by comparing images.
If you are trying to compare images based on pixels colors then you can use getPixelColor method of Robot class.
getPixelColor(int x, int... |
Forum: Java May 18th, 2009 |
| Replies: 7 Views: 763 Hello,
Firstly, Please post your code inside the [ CODE ] [ / CODE] tag.
There are many problems with your code and you really need to do hard work on it.
Its not a big deal to solve your... |
Forum: Java Apr 30th, 2009 |
| Replies: 3 Views: 861 Hey Sandhya,
Im not sure about NetBeans because i never tried it.
About connecting to MS Access using DSN. Then the default username and password is blank, But if you want there should be some... |
Forum: Java Apr 30th, 2009 |
| Replies: 9 Views: 308 hey sorry my mistake :P
do{
doCalculate();
}while(JOptionPane.showInputDialog(null,"Do you want to play again ? (y/n)").equalsIgnoreCase("Y"));
tested and working... |
Forum: Java Apr 30th, 2009 |
| Replies: 9 Views: 308 hey again,
change the loop in main method to :
do{
doCalculate();
}while(JOptionPane.showInputDialog(null,"Do you want to play again ? (y/n)").toUpperCase() == "Y");
If y... |
Forum: Java Apr 30th, 2009 |
| Replies: 9 Views: 308 hey again,
check now..
/**
* Write a description of class sqaurerootCube here.
*
* @author (your name)
* @version (a version number or a date)
*/ |
Forum: Java Apr 30th, 2009 |
| Replies: 9 Views: 308 Hey :D
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Demo extends JFrame {
public Demo(){ |
Forum: Java Jan 25th, 2009 |
| Replies: 4 Views: 437 Hello,
Check out java.util package.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/package-summary.html
Regards, |
Forum: Java Jan 11th, 2009 |
| Replies: 7 Views: 423 Hello,
1st difference is, you invoked takeShots() method first by creating object of ScreenPanel class to add it in frame. So before the frame got visible all the takeshots() processing got... |
Forum: Java Jan 10th, 2009 |
| Replies: 7 Views: 423 Hello again,
Heres the code
import java.awt.AWTException;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Robot;
import... |
Forum: Java Jan 10th, 2009 |
| Replies: 7 Views: 423 I dont think so, But if you can remove Thread.Sleep() then its quite possible. |
Forum: Java Jan 10th, 2009 |
| Replies: 7 Views: 423 Hello,
According to me, Once you start program you have to wait for 100 secs then a JFrame will be displayed with last image only.
Its because, you are using same thread to get image from... |
Forum: Java Jan 10th, 2009 |
| Replies: 20 Views: 2,251 Hello again,
And again its working fine for me.
public static void main(String[] args) {
for(File file : File.listRoots()){ // listRoots() method return list of drives. array of File... |
Forum: Java Jan 9th, 2009 |
| Replies: 6 Views: 1,133 yes,
if(e.getSource() == c) {// matching with JComboBox Object
if(c.getSelectedItem().equals("3")){
System.out.println("CORRECT!");
}else{
System.out.println("WRONG!");
}... |
Forum: Java Jan 9th, 2009 |
| Replies: 6 Views: 1,133 Hello again,
Heres a demo code:
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class GUIWindow implements ItemListener{... |
Forum: Java Jan 9th, 2009 |
| Replies: 20 Views: 2,251 Hello,
Code is working perfectly! No NPException. Using Eclipse SDK Version: 3.4.0.
Best of luck! |
Forum: Java Jan 9th, 2009 |
| Replies: 6 Views: 1,133 Hello,
FOR EVENTS:
you can use java.awt.events.ItemListener or java.awt.events.ActionListener interfaces.
TO GET SELECTED OBJECTS FRMO COMBO:
you can use getSelectedItem() method to get the... |
Forum: Java Jan 8th, 2009 |
| Replies: 12 Views: 823 Best of luck buddy! and don't forget to set this thread as solved :D |
Forum: Java Jan 8th, 2009 |
| Replies: 12 Views: 823 Input From File:
Scanner sc = new Scanner(new File("PATHTOFILE"));
Input From Console (On Runtime):
Scanner sc = new Scanner(System.in); |
Forum: Java Jan 8th, 2009 |
| Replies: 12 Views: 823 Hello,
Use java.util.Scanner class.
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
Demo Code :
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
Regards, |
Forum: Java Jan 4th, 2009 |
| Replies: 11 Views: 652 Please set this thread as solved. :D
Best of luck! |
Forum: Java Jan 4th, 2009 |
| Replies: 11 Views: 652 Then you better use Switch case or if else ( to get Suit and Rank ).
To check Flush, One Pair and Three Pair, you need to store old values in variables or arrays. I dont think theres any other way... |
Forum: Java Jan 4th, 2009 |
| Replies: 11 Views: 652 Im still confused on One Pair so i havent included it.
Code :
package com.puneetk.testwork;
import java.util.Random;
public class java
{
public static void main(String[] args)
{ |
Forum: Java Jan 4th, 2009 |
| Replies: 11 Views: 652 Hello,
I was playing with your code and found few errors in it.
I added this code of three lines:
System.out.println("Card Is : "+card);
System.out.println("CardRank Is : "+cardRank);... |
Forum: Java Jan 4th, 2009 |
| Replies: 3 Views: 470 Hello,
try it like this :
"apple\t2\t22"
"banana\t31\t1"
"orange\t1\t3"
escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
Edited : |
Forum: Java Jan 4th, 2009 |
| Replies: 12 Views: 1,353 Hello again,
Lession: How to Write an Action Listener
http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html |
Forum: Java Dec 29th, 2008 |
| Replies: 12 Views: 1,353 Oh, he's talking about variables in SQL Query.
Table structure :
-----------------------
Name : testTable
-----------------------
userID - int
username - varchar(20)
password - varchar(20)... |
Forum: Java Dec 29th, 2008 |
| Replies: 12 Views: 1,353 Hello,
Well if you want to dynamically add data into DB then you have to use variables. Its good programming practice to use variable ( ofcourse for essential ones only ).
Please mention the... |
Forum: Java Dec 28th, 2008 |
| Replies: 8 Views: 518 Yes, as verruckt24 said and as i know from my experience. It will do same working as before. |
Forum: Java Dec 28th, 2008 |
| Replies: 8 Views: 518 Hello,
I'm not sure but if you are looking for a decompiler. You can get one from here:
http://www.kpdus.com/jad.html
I have used it for my project as i misplaced java files. :P
Best of... |
Forum: Java Dec 25th, 2008 |
| Replies: 4 Views: 808 Good. Please set this thread as Solved and best of luck! |
Forum: Java Dec 23rd, 2008 |
| Replies: 3 Views: 698 I was playing with java codes and decided to check your code. Its working fine.
Its quite messy because i gave only few seconds but im sure you will get it
public class TestClass {
int... |
Forum: Java Oct 11th, 2008 |
| Replies: 4 Views: 604 Hello again,
If you have successfully added library to your project. Then just simply use Import statement in your java classes
Info about Use and Import Packages: Click Here... |
Forum: Java Oct 10th, 2008 |
| Replies: 4 Views: 604 Hello,
Right Click on project and go to BuildPath, then click on Libraries Tab.
Click 'Add Library' button then create a User Library, Name it and import JAR into that library.
Now, Select... |
Forum: Java Sep 20th, 2008 |
| Replies: 6 Views: 1,260 Hello,
For now, i have 2 ways in my mind. (Recursive method & Do While loop).
1st One) Create a method and cut body of main method into it. Then on showOptionPane if user entered YES then call... |
Forum: Java Sep 19th, 2008 |
| Replies: 3 Views: 1,165 Hello,
Please check here : http://java.sun.com/javase/6/docs/api/java/util/Stack.html
Hope this will clear your confusion :)
Regards, |
Forum: Java Sep 19th, 2008 |
| Replies: 8 Views: 2,050 Oops! sorry about that. Please mark this thread as Solved. :P
Regards, |
Forum: Java Sep 18th, 2008 |
| Replies: 17 Views: 1,775 Ok, Its done!
import java.io.*;
import java.util.*;
public class Postfix
{
private static Stack operators = new Stack(); |
Forum: Java Sep 18th, 2008 |
| Replies: 8 Views: 2,050 No, Im trying to help him with the simplest way as you can see he is newbie.
Even, im a newbie. im just sharing my knowledge here :) If im wrong, you seniors are here to help us.
Regards,... |