32,204 Topics
| |
My tic tac toe board is done, but I need it to show up in the Dialog box, not the console, how would I do that? Here is my code: javax.swing.JOptionPane.showMessageDialog(null, "\n-------"); for (int i = 0; i < 3; i++) { System.out.print("| "); for (int j = 0; j … | |
I am a student and have to submit a Mail Program. I have been asked to do the program using [B]GridBagLayout[/B]. The program is working fine but for the Layout. I just am not able to manage the layout problems I am facing in this program. Could I get some … | |
Im having arrayoutofbounds error on my code. [code] import java.io.*; class s{ public static void main(String args[]) throws IOException{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); String[] a = {"X","C","O","M","P","U","T","E","R","S"}; System.out.println("Enter Price: "); String b = in.readLine(); for(int i=0;i<b.length();i++){ System.out.print(a[b.charAt(i)]); } } } [/code] what am i doing wrong here? The output should … | |
Hey guys, I wanted to know how can I code the game ball lines in Yahoo. It is a game very easy to understand and similar to tic tac toe but I just cant figure out anything as to how to start. Please help!! u can mail me on [email]chandanagrawal17@hotmail.com[/email] … | |
step 1 myeclipse->prefernces->myeclipse->application servers->choosing tmcat5.5 for application server Step 2 using jdk 1.5 clicking ok then clicking on icon to start and stop tomcat but it says that no default server present what might be missing plz tell | |
I am using generics in java, and I want to know how I can test to see if I have a int or a float? Is there some sort of type-testing? I'm sure there is, I just need someone to help point me in the right direction. Thanks! | |
can anybody see anything worng? I'm returning these to the main sO=ScoreO(O); sX=ScoreX(X); These are my two methods: [java] //method to tally the score for x public static int ScoreX(boolean X){ int scoreX=0; if(X==true){ scoreX+=1; } return scoreX; } //method to tally the score for x public static int ScoreO(boolean … | |
For a homework assignment, I have to create a random salary generator which is pretty easy. We have to create a random number of employees, 3-15 only and then the number of years of that salary with a limit of 3-15. This is easy so far. After this, we have … | |
Hi guys I started to learn java and have a little problem\. When I try to compile my little program it says : assgn2.java:40: variable overnight might not have been initialized System.out.println(overnight); [CODE]How is that? The code: import java.io.*; public class assgn2 { public static void main(String[] args) throws IOException … | |
I am executing a project that have 100 jar file attached to it I am able to execute it in Eclipse but i want to run it from batch file but the problem is that i am not able to set class path , whereas in eclipse we can direclty … | |
I need help making a counter uusing a two dimmensional array. I'm doing a tic tac toe program and need about done, just need the counter and have no clue how to do it. | |
So we're supposed to modify this class, which implements Comparable, so that it accepts any type of object. The Comparable interface contains the method signature for compareTo, which I need to implement. What I'm uncertain of is how to implement this method. I know that compareTo is supposed to return … | |
HI problem: Write the definition of a class Clock . The class has three instance variables: One of type int called hours , another of type boolean called isTicking , and the last one of type Integer called diff . You should also write a constructor that takes three parameters … | |
hey everybody!! i urgently need a project in java for electricity bill generation software kindly contribute as much as possible... i m in real trouble | |
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Registering driver type Connection con=DriverManager.getConnection("jdbc:odbc:proj"); // Assigning drivermanager con.setAutoCommit(true); //String str="insert into dovetail values('"+id+"','"+a+"','"+b+"','"+res+"')"; String str="insert into dovetail values('ASDF','Raj','1234','198')"; Statement stmt=con.createStatement(); // creating statement object int ret=stmt.executeUpdate(str); System.out.println(ret); if(ret==0) { System.out.println("Not Inserted"); } else { System.out.println("Data Inserted Successfully"); } /*str="select * from dovetail"; ResultSet resl=stmt.executeQuery(str); boolean val=resl.next(); while(val) { … | |
pl. help me in how to export and import MsExcel in java | |
Hello everyone please i need help .. i am new 2 java and i was given this assigment of which i dont even know where to start from...If anyone can help please IM me so i can send him the question or perhaps for a little guidance on how to … | |
How to learn in the most effective and efficient way. thank you | |
Hi Please help me with this problem Write the definition of a class Play containing: An instance variable counter of type int , initialized to 0. A method called increment that adds one to the instance variable counter . It does not accept parameters or return a value. A method … | |
I need help understanding why my code doesn't work while using number coordinates. I'm using a two dimensional array, I would like to post my code so you guys can check my errors, but I don't want anybody else to steal it, can anybody help? | |
I have been given a homework this is it: [QUOTE]Homework 7 Due in your lab in week 10 For this homework you are expected to write one program, which consists of a main method and an insertWord() method. You must work on the program outside the formal laboratory sessions. The … | |
hi, I have created servlets for hotel management. In that i want to create a search engine to search the customers by their name & by their room no so will u please help me out in that. | |
My loop keeps looping...even after the condition is changed to false. Whether I enter a "y" or an "n" my loop still loops. I know it's never leaves the loop, because I never get the "do I get here" println. This is my first time with booleans...so maybe I'm doing … | |
hello, i am a new comer. is it possible [COLOR="Red"]to read data (e.g. some integers followed by a unique word) from a defined web page of a defined web site?[/COLOR] if possible please help me or suggest me which language is appropriate to do the job......... | |
Is there a way to find if an entry is indeed a number without using try/catch? I want the program to keep asking the user to enter a number if s/he is "silly" enough to input something else. [code] System.out.print( "\n¿Edad minima a buscar? " ); edadMinima = input.nextInt(); [/code] … | |
Hello all -- found myself stuck on a certain bit of code dealing with a number pattern I put together. I've written out most of the code, but I'm stuck in 2 areas - thought maybe someone could help shed some light. It seems like it would be very simple, … | |
I guess I'm having a lot of problems tonight with this program I'm trying to accomplish for myself... I'm trying to write an application called TestNumFactors which defines a static method with header "public static int numFactors(int n)". When numFactors is called, it should return the number of factors of … | |
[B]how to open any exe file using java. i alrerady used the Runtime.getexec() code. but when i refresh the page the application is opening. my thought is the application should be open after clicking the button in jsp page. if u have any code send me.[/B] | |
So here's the problem [QUOTE]Write a program that asks the user to input a set of floating-point values. When the user enters a value that is not a number, give the user a second chance to enter the value. After two chances, quit reading input. Add all correctly specified values … | |
Just curious... I've got a snippet of code I'm trying to put together, and what I'm trying to get it to do is to print out the word "yes" exactly when i ends in the digit 4, or j ends in the digit 7, or both. I know my if … |
The End.