32,204 Topics

Member Avatar for
Member Avatar for keval_hack

I want one TextField on Applet and user enters URL in that TextField and then displays the document of the URL string in a new browser window.

Member Avatar for NormR1
0
83
Member Avatar for programing

hi i was writte program that implement one-d array user enter 10 element without any duplication it is give me all element its already exist [CODE]import java.util.Scanner; public class Duplicates { public static void main(String[] args) { Scanner input = new Scanner(System.in); int[] array = new int[10]; int[] copyarray = …

Member Avatar for stultuske
0
638
Member Avatar for programing

i made code that calculate fibonaci number (n) but how i can determine the largest fibonaci number [CODE] import java .util.Scanner; public class Fibo { public static long fib(int n) { if (n <= 1) return n; else return fib(n-1) + fib(n-2); } public static void main(String[] args) { Scanner …

Member Avatar for stultuske
0
598
Member Avatar for bibiki

hey there, I am trying to test strings using regex to make sure that the string may represent a monomial. that is, it must be 123123213x^213123. I am having difficulties to find any helpful information on how to test for ^. I am trying this: [+|-][0-9]*[.][0-9]*[x\^]? but I get a …

Member Avatar for bibiki
0
112
Member Avatar for Ricky116

Hi, been reading these forums for a while because I find I learn a lot without actually having to spend time coding my own projects, but here's my first question. I am looking to develop a very simple program that can display all movie files (.avi at least to begin …

Member Avatar for Phaelax
0
122
Member Avatar for gourav1

[CODE]public class A extends Applet implements MouseListener,MouseMotionListener{ public void init(){ addMouseListener(this); addMouseMotionListener(this); } }[/CODE] please tell me that what "this" means here!! actually, what argument addMouselistener() function want ? i have seen API, in that it is given "MouseListener e", how it is true here ?? tell me please!! here …

Member Avatar for NormR1
0
136
Member Avatar for programing

hi can someone explain this small code how its work : [CODE]/** * @(#)Output.java * * * @author * @version 1.00 2011/12/24 */ public class Output { public static int rec(int x, int n) { if (n < 0) { System.out.println("Illegal argument"); System.exit(0); } if (n > 0) return ( …

Member Avatar for predator5047
0
131
Member Avatar for programing

my code should print numbers in reverse array its not have error but the lest for statement its not print array in reverse order [CODE] import java .util.Scanner; public class R { public static void main (String [] args){ Scanner input=new Scanner(System.in); int size; System.out.println("Size "); size=input.nextInt(); int [] array=new …

Member Avatar for NormR1
0
244
Member Avatar for programing

can help me in this code i made it to check if a given number is plindrom or not [CODE] import java .util.Scanner; public class PNumber { public static void main(String[] args) { System.out.println("Enter size "); Scanner input = new Scanner(System.in); int size = input.nextInt(); int [] array=new int [size]; …

Member Avatar for .:n'tQ-boy:.
0
200
Member Avatar for raul8

Hi, I have a string which contains XML. I want to remove its first line and save it back to String. How can I do that? Thanks

Member Avatar for Aviras
0
68
Member Avatar for vijaykavin10

Hi All [CODE]package apple; import java.io.IOException; import java.util.Scanner; /** * * @author Mates */ public class Apple { private double sample(){ double total; int a=120; Scanner as=new Scanner(System.in); System.out.println("enter the value"); double i=as.nextDouble(); total=i*a; System.out.println("apple"+i+"kg"+" "+total); [COLOR="red"]return total;[/COLOR] } public double sample1(){ int b=50; double total1; System.out.println("enter the value of …

Member Avatar for vijaykavin10
0
273
Member Avatar for rssk

hi........ i'm new to java...... i m running a java program on cmd prompt,i want to compile but i m getting error like [B]'javac' is not recognised as internal and external command ,operable program [/B] plzzzzzzzzzzz help me:)

Member Avatar for peter_budo
0
552
Member Avatar for SubzeroX6

Hi, I've been trying to learn how to do collision between a sprite and a tile for a while, so I've been testing this point collision I found from a Java book. But for some reason, the tile's images can't be drawn onto the screen. Any Ideas or thoughts to …

Member Avatar for NormR1
0
328
Member Avatar for lethal.b

I am writing a program using J2ME and my goal is to count how many times each character appears in a string. I am not very good at java so the way i see i should do this is create 2 arrays. First array is used to hold characters. Second …

Member Avatar for lethal.b
0
185
Member Avatar for Hussam Alahmadi

Hi every body i have a Question How to find lowest number? this my code is there any mistake ? [CODE] import java.util.Scanner; public class MaxNumber { public static void main(String[] args) { Scanner input = new Scanner(System.in); int min = 0 ; int count=1; System.out.println("Enter a number : "); …

Member Avatar for nHulk
0
179
Member Avatar for hszforu

When i make 2 object for a same class, and then i make one object equal to another, then changes made to one object affect another object also, then when i assign one object as "null" then why the change is not made to another object as well? Here is …

Member Avatar for hszforu
0
124
Member Avatar for jackmaverick1

So. I've written my first little graphics game (using the Graphics API) and would like to know two things: a) What's wrong with my collision detection? (Could you point me in the right direction?) b) What am I doing that is not the best way. Is there a better way …

Member Avatar for JamesCherrill
0
121
Member Avatar for programing

plz i try to make factorial program but i have mistake [CODE] import java .util.Scanner; public class Factorialrec { int fact(int n) { int result; if ( n ==1) return 1; result = fact (n-1) * n; return result; } } public static void main(String [] args){ Scanner input = …

Member Avatar for programing
0
126
Member Avatar for JavaPrograms

Assignment :: TwoLargestElements Complete the following program so that it computes and writes out the two largest elements in the array. So far I have this...and it just gets the largest number for both outputs..I need to change it so I get both the largest and second largest. Any help …

Member Avatar for rickypounting
0
2K
Member Avatar for Bahirji Naik

This may be old error but I stuck here.. I created java database applet for oracle database. I am going to put this applet in Local Network. My applet works fine in Eclipse and Netbeans but when I run through 'appletviewer' it showing an error : [ICODE]Error e java.security.AccessControlException: access …

0
72
Member Avatar for joankim

Hi there, I started learning Java this year, and I must say that I am surprised how good I have gotten at it. I still have a bunch to learn, but I am able to make my own programs that does a lot of different stuff. I am taking AP …

Member Avatar for joankim
0
197
Member Avatar for bibiki

Hey there, I have already built my system to log in but I am having difficulties in proceeding with the new panel I want to show after log in is successful. This is how I'm doing it: I have built different panels for each use case of my app. So …

Member Avatar for bibiki
0
121
Member Avatar for Genericusername

Hello, I'm writing a program that creates repetitions of a section of a word. I'm trying to get the program to evaluate the data i send to the tester method, and return true or false depending on whether or not it is a valid input. [CODE] import java.util.Scanner; public class …

Member Avatar for Genericusername
0
187
Member Avatar for jacob501

Hi. I am making a python program that automatically enters information into a form on a website. I looked at a module called mechanize at first but then I realized that it didn't support javascript. Is there any way to take a piece of information and insert it into a …

Member Avatar for jacob501
0
125
Member Avatar for daudiam

[CODE]@Local public interface EJBA{ // declares a method 'validate' } @Stateless public class EJBABean implements EJBA{ // implements the method 'validate' } class Model{ @EJB private EJBA ejbA; public void doSomething(){ ejbA.validate(); } } [/CODE] Now, if I do the following from the execute method of a Struts 1.2 action …

0
103
Member Avatar for stevanity

I need to parse this document with email ids and convert them to a csv file... source. [CODE]xxxx@xxx.com; hello@gmail.com; John (john@hotmail.com);[/CODE] and so on.....lots of emails are there :D output: [CODE]NickName, Email ,xxxx@xxx.com ,hello@gmail.com John,john@hotmail.com[/CODE] Please help me. This aint a homework. Im trying to recover my emails... hehe. I …

Member Avatar for stevanity
0
127
Member Avatar for 03hasnam

[CODE]import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Login extends JFrame{ JButton SUBMIT; JPanel panel; JLabel label1, label2; public static int accessGrant = 1; JTextField username; JPasswordField pw; public Login() { label1 = new JLabel(); label1.setText("Username: "); username = new JTextField(15); label2 = new JLabel(); label2.setText("Password: "); pw = new …

Member Avatar for NormR1
0
144
Member Avatar for serdas

hi, is it possible to have two different version of java on linux centos5 currently it is running 1.6.0 - which i would like to keep it that way sinse i have red5 but i also need 1.4 for a gaming server ES gaming server is asking to use at …

Member Avatar for serdas
0
369
Member Avatar for 03hasnam

[CODE]ImageIcon tenP1 = new ImageIcon("10p.gif"); tenP = new JButton("", tenP1); ImageIcon twentyP1 = new ImageIcon("20p.gif"); twentyP = new JButton("", twentyP1); ImageIcon fiftyP1 = new ImageIcon("50p.gif"); fiftyP = new JButton("", fiftyP1); ImageIcon pound = new ImageIcon("pound.gif"); onePound = new JButton("", pound); ImageIcon twopound = new ImageIcon("twopound.gif"); twoPound = new JButton("", twopound);[/CODE] …

Member Avatar for 03hasnam
0
3K
Member Avatar for joankim

Hi :) I am trying to make a program that will find the first x perfect squares. I have done and redone this many times, but it never works. So basically, it needs to do two things: check if y is a perfect square. If it is, it needs to …

Member Avatar for joankim
0
951

The End.