36,051 Topics

Member Avatar for
Member Avatar for IQLion

class t{ Somebody please help me with one very simple program in java. I'm new to java, so I can't understand what all this errors about. Please help me fix this program. It gives three errors: illegal start of type swith (s) orphaned case case 'Y': <identifier> expected switch (s); …

Member Avatar for PopeJareth
0
173
Member Avatar for sotvisal

import java.util.*; class Degree2 { Scanner in() { return new Scanner(System.in); } void out(String m) { System.out.print(m); } double readDouble(String m) { out(m); return in().nextDouble(); } String readString(String m) { out(m); return in().nextLine(); } void foundRoot(double a,double b,double c) { if(a==0) out("Value x is: "+(-c/b)+"\n"); else { double data=(b*b)-(4*a*c); if(data>=0) …

Member Avatar for harsh2327
0
391
Member Avatar for sotvisal

[code=java] import java.util.*; public class Convert { Scanner in() { return new Scanner(System.in); } void out(String m) { System.out.print(m); } long readLong(String m) { out(m); return in().nextLong(); } int readInt(String m) { out(m); return in().nextInt(); } String readString(String m) { out(m); return in().nextLine(); } String digitOne(int n) { String st=""; …

Member Avatar for tux4life
0
160
Member Avatar for solahere

This is what I am trying to do... I have a image and I create a bufferedImage and graphics out of that using: [CODE=java] BufferedImage img = ImageIO.read(file); Graphics2D g = img.createGraphics(); [/CODE] Now I play with the graphics and finally save the file using: [CODE=java] File outputfile = new …

Member Avatar for JamesCherrill
0
191
Member Avatar for woyelami

am begin you people help send the available links or books to my mail. i wont to become a java programmer, but is been a long time have been reading so many book without any good understanding of the language called java. i also interested in been certify. please any …

-1
46
Member Avatar for Godstryke

Hi all, I'm currently learning Java right now through a class and my instructor has asked me to try writing a word-count program using a Map interface. It should run through command line and has to identify the number of words, the number of distinct words, and the distinct words …

Member Avatar for Godstryke
0
1K
Member Avatar for peggie1990

Hey guys do you have any samples that uses hashtable in multi part form to insert image and information into database. In the jsp form, there is some codes regarding on hashtable that is input into by my tutor. However, I do not understand about it. My tutor taught me …

0
52
Member Avatar for bigbadbag33

hello all, I am trying to create a class for an inventory program that will store certain values like name, item number number of units and price. I have written a code but it is apparently not correct because I get several error messages. can you please look at what …

Member Avatar for VernonDozier
0
98
Member Avatar for Web_Sailor

Hi, I am trying to print a String value like this but still not able to get it,. my method is like this:- [CODE] Class1 { public String mystring; public void mymethod(){ mystring = ""; } //Then I am setting the value of mystring in other method like this:- public …

Member Avatar for Godstryke
0
95
Member Avatar for KirkPatrick

Hey guys, I was having a bit of trouble with making my GUI look presentable (not too busy or crammed up) and I have a few questions that shouldn't be too hard to answer. I'll briefly explain what I have at the moment. I have a total of 15 text …

Member Avatar for KirkPatrick
0
1K
Member Avatar for harshit99

hiii... i am writing an application in jsp to create a login form. but it shows an error : string not properly closed at line 7. also the java script included doesnot show any error message ... here is the code: [code=HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> …

Member Avatar for harshit99
0
123
Member Avatar for shivaa

Question - Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set up stack …

Member Avatar for shivaa
0
85
Member Avatar for Dhrubajit Kalit

please help me in writing a program in java "A student has a name,roll no., class, home address, date of birth. First dessigne a suitable class for date, write constructor and get and set functions. Then dissign a class for students informations. Write constructor, get and set function to calculate …

Member Avatar for axeeffect2002
0
89
Member Avatar for beshoyatef

When i write like This: [CODE]JTextArea area=new JTextArea(); [/CODE] then i can do this :[CODE] area.append("");[/CODE] But when i write this : [CODE]JTextPane area=new JTextPane(); [/CODE] Then i can not write [CODE] area.append("");[/CODE] so what is equal append() method when i use JTextPane???? thanks in advance

Member Avatar for kvprajapati
0
67
Member Avatar for spalax

Hi all, i'm trying to get a specific line in a text from a text file. In fact i want to read just the eight first line from my text file. It's only return the four first line. why? here is my code but, there is Format problem. [CODE]import java.io.*; …

Member Avatar for sneaker
0
289
Member Avatar for choybutchoy

hi, Im just wondering on how I could get a columns and a record count I mean the whole thing in a database aside from executing this statement [icode] "select count(*) from myDatabase" [/icode]...is there another statement that i can use instead of this one coz it doesnt retrieve any …

Member Avatar for choybutchoy
0
144
Member Avatar for xonxon

[code] import java.util.*; class Salon { static Scanner sc = new Scanner(System.in); public static void main (String[] args) { int skinType,option,maskType,massageType; System.out.println ("\t\t*********************"); System.out.println ("\r Welcome to Sally Salon"); System.out.println ("\r Services available:"); System.out.println ("\r 1.facial and massage"); System.out.println ("\r 2.facial only"); System.out.println ("\r 3.massage only"); System.out.println ("\t\t*********************"); System.out.println ("\t …

Member Avatar for xonxon
-1
101
Member Avatar for ArunRaj.SRM

Hi, I'm having a page like below : [code=jsp]<html><head><body> <FONT COLOR=RED SIZE=5> <%@page import ="com.ui.CTransactionManager"%> <%@page import ="com.ui.CUser"%> <% String UserId = request.getParameter("UserId"); CTransactionManager objmanager = new CTransactionManager(); CUser user = objmanager.getUser(UserId); String m_staff_id = user.getStaffId(); out.print( "Staff Id : " +m_staff_id ); %> </font></body></head></html>[/code] here i want to pass …

Member Avatar for ArunRaj.SRM
0
165
Member Avatar for dlaniger

Hello- I just joined and have read the thread:[url]http://www.daniweb.com/forums/thread48188.html[/url]. I was advised to start a new thread as that one is to old now. Anyway, I have the same problem and am trying to use the "hidden" input tag to access the parameters I need in the jsp. My code …

Member Avatar for kvprajapati
0
922
Member Avatar for alsoumhi

Hi experts, I have two questions, please help me because I am trying to create an application and I stopped because of these 1) how to read data in servlet from a web page for select menue I have used [request.getParameter("?????")] but I don't know which name I put inside …

Member Avatar for masijade
0
75
Member Avatar for malou_baby08

hello, can u pls help me sir about my problem in the level order travelsal?... i did trace my code and i found no wrong. but when i compile it, there's something wrong in it and i dont know where... thank u very much! [code] int count = 1; public …

Member Avatar for malou_baby08
0
69
Member Avatar for cmaclennan

Hey Guys, I have a form that allows for additional rows to be added based on the number of serials being entered however I have just noticed that it cuts off at 9 rows and starts to repost the first 9 rows again for anything past that and i can …

Member Avatar for BestJewSinceJC
0
96
Member Avatar for hajjo

hello, what is java spring? i read its a framework. but what compiler do i use to work with it? and from where i can download java spring? i tried this page [url]http://www.roseindia.net/spring/springdownload.shtml[/url] but their explanation, i dont find the things they put.

Member Avatar for BestJewSinceJC
0
118
Member Avatar for onindita

hi, i m very new here and also in programming world. i tried to make a program that prints happy and unhappy numbers. but that prints only unhappy numbers and then it goes back to while loop where j remain 0. how can i fix the problem? plz someone help …

Member Avatar for BestJewSinceJC
0
143
Member Avatar for beshoyatef

Itry to move text in tTextarea to left or to center or to right by pressing to buttons i did like this but unfortuantly it is not work . [CODE] public void actionPerformed(ActionEvent e) { if(e.getSource()==buttons[0]){ area.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); } if(e.getSource()==buttons[2]){ area.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } } [/CODE] area if an object from JTextArea can …

Member Avatar for quuba
0
102
Member Avatar for Josh_Hcq

I'm working on a project in which i have to use J2ME. I've tried a few tutorials but they seem only to be especially oriented to specific problems, and in my programming experience i've learned that's always better to globally know your environment. If anyone knows an e-book (or book) …

Member Avatar for peter_budo
0
105
Member Avatar for Shaun1987

Hi, I am very new to Java and am using Breezy Swing. I basically need to create an array of JButtons (26 in total) and display them on a form (9 on the top row, 9 in the middle and 8 on the bottom) and I have no idea of …

Member Avatar for anand008
0
1K
Member Avatar for Matchuel

Good Day, I am using an Ms Access Database to design a StockTracker applicaton. The application is used to check the stocks of users. Firstly I need to sign on as an administrator and then be able to add users and their stocks to the database. I have created the …

Member Avatar for Matchuel
0
129
Member Avatar for knowledgelover

hi there, how can I change string to xml and vise verse in java, in addition how can I add values to xml according to element name , I can imagine something like "setValue(elementName, the value) ; as we are using in java, any suggestions any help , please! thanks …

Member Avatar for knowledgelover
0
139
Member Avatar for shanakaprabath

I wrote a program to write data in a text file to another text file .what i want to do is to open that modified second text file once I've entered data in to that

Member Avatar for solahere
0
1K
Member Avatar for picass0

i wanted to print random line from a file. i knows how to print out the whole file but doesnt know how should i do to print a random lines from a file!!! hope someone can give me some ideals or an example. thanks!

Member Avatar for solahere
0
83
Member Avatar for Tmanchester

Howdy, recently I saw something very strange popping up in my catalina.out log files. Where I used to see a class name and line number for the exception I now see "Unknown Source". Does anybody have any ideas why that happened? I need to get the class name and line …

0
45
Member Avatar for nava123

Java vs .NET Which platform is better according to your opinions, Java or .NET, Post your reply here

Member Avatar for Salem
-1
24
Member Avatar for gitech

Hai friends, How to send and receive mail from my gmail account through java program.is there any way to access?

Member Avatar for sawjig12
0
89
Member Avatar for sravan953

Hey guys, In Java, there is a method called substring, but what substitute does it have in Python, or do I have to explicitly do it like: [CODE] s=raw_input("Enter a sentence: ") s2="" a=0 b=0 for a in s: if(a==' '): s2= s[b:a] b=a a+=1[/CODE] Thanks guys!

Member Avatar for jlm699
0
330
Member Avatar for ashish2234

I have just made a banner in java applets and in status window also i have used a banner but in reverse direction to that of the other banner but the banner in status window does not make use of the whole space of the window and just runs in …

Member Avatar for ashish2234
0
107
Member Avatar for elnuk

how to prevent unauthorised user from accessing a file by typing the URL directly using a servlet as the preventive measure is what has been a sore for me for some time now.i would be very grateful for any opinion.thanks

Member Avatar for elnuk
0
778
Member Avatar for mailtogsuresh

Hi Every body Good Day with u.... Help..me for How to find the details like IP, username, any updationby him of the visitors visit my webpage in java

0
43
Member Avatar for ndoe

hi all!i have problem to show JPanel in netbean with button here's the code [code=java] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed NewJPanel x = new NewJPanel(); x.setVisible(true); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 30, Short.MAX_VALUE) .addComponent(x) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 30, Short.MAX_VALUE) .addComponent(x) ); [/code] my question how …

Member Avatar for ndoe
0
143
Member Avatar for hell04

Q: Write a program that will determine if a number is even. The program should ask for a number, say X and printout whether "X is even" or " X is not even". This program must use a method with the signature "public static boolean isEven(int i)".

Member Avatar for hell04
0
126
Member Avatar for amit

Respected mem, I m struggling to make a project on inventory management system. Which has 5 option on first screen.I will tell u later the remaining. Can u plz. help on this project.

Member Avatar for praveenkonduru9
0
285
Member Avatar for Masood Ali

Hi All I want to check whether there is a record present in my database with value: StartDate="Todays's Date" where start date is the column name with datatype DATE.

Member Avatar for Sakthimeenakshi
0
201
Member Avatar for majestic0110

Hi all, I hope you are well. I am trying to explain some code to a friend : [CODE]StringConcatenate StringConcatenate1 = new StringConcatenate(); StringConcatenate1.stringConcat(); [/CODE] I said that this code creates an object "StringConcatenate1 " of type StringConcatenate and executes method stringConcat() (which is from class StringConcatenate()) on object StringConcatenate1. …

Member Avatar for majestic0110
0
204
Member Avatar for guyod

Hi, I was wondering if any one can help me with returning a array element to the main function. The array list will be the main function. I want to send the array list to a method that adds a element to that list and then send it back to …

Member Avatar for javaAddict
1
99
Member Avatar for zghotlawala

hi, Well i am planning to develop the chatting application peer to peer as front end tool java so please guide me how the data will flow?

Member Avatar for harsh2327
0
37
Member Avatar for jdfskitz
Member Avatar for simplypriti

Hi All, I need information of a better Java hosting service (better in terms of performance, security, storage, reliability). So if any of you know such kind of service provider thn kindly let me know ASAP. It would be great help from your side. :) Thanks, Priti

Member Avatar for ithelp
0
88
Member Avatar for acp08dvp

Hello everyone, I am doing a project in which one requirement is to play a sequence of audio files..can someone help me with this please...i am really running out of time i just have 1 month to finish my project...

0
63
Member Avatar for garimarajesh

Hi, I need the solution to the below mentioned problem: A Scroll Banner is an applet which displays 2 scrolling messages across the applet’s Window. Since the scrolling of a message is a repetitive task, it is performed by a Separate thread, created by the applet when it is initialized. …

Member Avatar for nipunsaxena
0
99
Member Avatar for sotvisal

import java.util.*; class FindString { public static void main(String arg[]) { Scanner ob=new Scanner(System.in); String st="I am a student, you're also a ."; String search; String st2=""; String st3=""; int i,c=0; System.out.println(st); System.out.println("Enter your word to search: "); search=ob.next(); do { i=st.indexOf(search); if(i!=-1) { st2=st.substring(0,i); st2+=st3; st2+=st.substring(i+search.length()); c=c+1; st=st2; } …

Member Avatar for harsh2327
0
115

The End.