36,051 Topics

Member Avatar for
Member Avatar for mynamewontfitin

Hey - Sorry if this is an irritatingly simple problem, but I'm a newbie to the Java language and I can't see where I'm going wrong with this. I get an error with my code when trying to define 'label3' - "cannot find symbol - class Jlabel". It seems to …

Member Avatar for mynamewontfitin
0
2K
Member Avatar for varun45

I am having difficulties with placing images on Buttons using Java Swing. I have placed all images in a package named icon. The frame is loading as well as the buttons. I cant seem to get the images on the buttons. Can anyone point out my mistake please. [CODE]public Launch(){ …

Member Avatar for varun45
0
990
Member Avatar for pushpap7

//create the images folder and past all images into that u want to display... import java.awt.Color; import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; class my { public static void main(String args[]) { JFrame f=new JFrame("Web layout..."); ImageIcon pic1 = new ImageIcon ("images/3d.png"); ImageIcon …

Member Avatar for JamesCherrill
0
4K
Member Avatar for aldeene

my program freezes when I put this code on a button, but when I put it in the main it doesn't what could be the problem? protected void EstablishClient() { try { skt = new Socket("some.ip.of.me", 4444); out = new PrintWriter(skt.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(skt.getInputStream())); txtRecvd.append("Received string: '" …

Member Avatar for aldeene
0
113
Member Avatar for nHulk

I am trying to import all the classes present in a user defined package, by using the statement as import mypack.*; but it's not working in my program. [B][B]Its Giving error : C:\Users\Nitin\java>javac AOTest.java AOTest.java:6: cannot access AOperation bad class file: .\AOperation.java file does not contain class AOperation Please remove …

Member Avatar for nHulk
0
203
Member Avatar for Dmiller071

The title says it all. Basically what I'd like to do is have a JComboBox drop down with a list of items. When the user clicks on that item it will redirect them, or open a new browser tab, of the url to that specific item. Quick example (these sites …

Member Avatar for Dmiller071
0
178
Member Avatar for jhellr13

Hey guys I have to write this program for AP Computer Science. It involves writing a main where it brings in a txt file with values, and reads all of them. Eventually, I have to modify it to read the values in to an array. Right now, I can't get …

Member Avatar for Trentacle
0
161
Member Avatar for Morley93

Hi all, I'm a long time reader of the forums and thought this would be a good place to ask a question. For the record, I am very new to Java! Basically, I have a [I]MainClass[/I] which inherits JFrame, the constructor for which sets window size, title etc. It also …

Member Avatar for Morley93
0
555
Member Avatar for madhub2v

hi Friends can you pl help me to create a simple snake game. give me with step by step creation. thanks.

Member Avatar for Ezzaral
0
2K
Member Avatar for creative_m

Hi I have a class which has alot of tasks related to multiple classes. the tasks are add, modify ,delete, write on a file and read array from a file.all theses methods operates on objects of other classes as a member variables. In other words, I have to perform a …

Member Avatar for creative_m
0
119
Member Avatar for raichand

Hi i am looking for simple intranet project in java with mysql.Can anyone post this kind of project or suggest some sites. Appreciated if u replay on this. Cheers!

Member Avatar for Ezzaral
0
165
Member Avatar for Mudzy

I want to extend JFrame needed for my GUI program but i get this.. [URL="http://imageshack.us/photo/my-images/209/screenshot20111226at163.png/"]http://imageshack.us/photo/my-images/209/screenshot20111226at163.png/[/URL] how do i solve this?

Member Avatar for JamesCherrill
0
187
Member Avatar for Hussam Alahmadi

Hi every body How to find smallest number and how many occurrence with the user input numbers until enter 0 ? this my code ....... [CODE]package javaapplication101; import java.util.Scanner; public class JavaApplication101 { public static void main(String[] args) { int num = 0 , min = num ; int count=0; …

Member Avatar for stultuske
-1
170
Member Avatar for R32@

Hello, I'm new in Java and this is my first post here. I was doing my homework but faced the following error: [QUOTE]c:\java\my box\Login.java:25: variable p might not have been initialized if (p == pass) { ^ 1 error[/QUOTE] You can see the main code bellow: [CODE]import java.util.Scanner; public class …

Member Avatar for R32@
0
112
Member Avatar for gourav1

i m doing jdbc in sql server. when i have installed it then it is asking for connection. in server column what i need to write ? by default "(local)" is there and when i press connect button, it says "error reporting!!" and some description about that. what is this …

Member Avatar for gourav1
0
113
Member Avatar for udayashan

Hi, Can anyone please help me in resolving this issue. I have an eclipse galileo IDE . In that i m trying to test the web service in the web services explorer. [url]https://ccmuat.ultimatix.net/scpghd/servicerequest.asmx?wsdl[/url] .... this is URL. But i m facing an error when testing this URL ERROR : IWAB0379E …

0
62
Member Avatar for axim0

Good Evening i hope i will be clear and fully details. i have created a web service project on netbeans using soap technology. i am using xampp mysql to create 5 different simple hotel databases. from my project i am connecting with jdbc connector succesfully only to 1 database. that …

Member Avatar for ~s.o.s~
0
705
Member Avatar for swaroopeswara

i am having a table td_user_login. the table consists of user_Id,login_time,session_id.ip_address. so, after creating the login page i want to see the login member login time with concurrent date and want to view a bar chart under jsp. so can any one help me out in solving this.

0
38
Member Avatar for JerryRong

i created a loop and it doesn't run: [CODE] for ( int i = 0; i < 100; i++) { for( int j = 0; j < 100; j++); { int total = i + j; } System.out.println( total ); }[/CODE]

Member Avatar for DavidKroukamp
0
122
Member Avatar for gourav1

hello! i m doing advance java now. and i m not getting any solid book for reference to read. actually, what i want in book is that it must have sample problem given with each concept! means it should be too explained. please refer a book from which i can …

Member Avatar for Trentacle
0
113
Member Avatar for rahul_galgali

Hi,/ I want to start with Java Application for Data Hiding in which image is kept as watermark.I want to start with this app but I have no idea how to start with it..I am vc++ programmer but i m not familiar with java so plz If u could help …

Member Avatar for rahul_galgali
0
182
Member Avatar for memo1
Member Avatar for NormR1
0
57
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
85
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
639
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
601
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
116
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
125
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
139
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
133
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
247
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
202
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
70
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
295
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
554
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
330
Member Avatar for softDeveloper

Hi All! I'm working on a web application, JSP, where a user selects the text with the mouse in html. I want this text to be inserted in a MySQL database as a java string using prepareStatement in Java and executeupdate. Example: String querystring = "INSERT INTO mySelectedTextTable(selectedTextWithMouse) VALUES (?)"; …

Member Avatar for softDeveloper
0
212
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
191
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
216
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
126
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
125
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
129
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
74
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
201
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
123
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
190
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
127
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
106
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
131
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
147

The End.