36,051 Topics

Member Avatar for
Member Avatar for Valkerion

Greetings from Greece. We got a Hangman assignment for my Class at Java. I m just a begginer.And the whole input/output thing is done either by console (system.out.println) or with JOptionPane. So here is my code [code] import javax.swing.JOptionPane; import java.util.*; public class Hangman { public static void main (String …

Member Avatar for blog_user
0
1K
Member Avatar for cppStudent

Hi! I implemented a Binary search tree, which worked as desired. Then I had to create a new class which inherits from "BinarySearchTree" called "SplayTree". "SplayTree" has only one method called "contain" which overrides the inherited "contain". The new "contain" will return a boolean. If the object is found in …

Member Avatar for cppStudent
0
120
Member Avatar for prashant1111

is it possible to SIMULATE NETSTAT COMMAND IN JAVA? if possible please tell me how. if possible please give an example(code). thank u in advance.

Member Avatar for masijade
0
61
Member Avatar for robertab14

Hi, Are there any validations which can be done on text boxes like for eg restricting that the user must enter some text, to be used for eg in login forms. And regular expression validators for eg to validate an email address? 10x

0
49
Member Avatar for caps_lock

Hi, I looked for this on Google, but to no success. Can anyone help/point me in the right direction as to how include a terminal window in an exectuable jar file?? Outside the IDE, I can only access my program by command promt, Im not fussed about layout, I just …

Member Avatar for Ezzaral
0
62
Member Avatar for Karas87

Hi everybody, I have the following URL to grab: [url]http://www.mysite.com/profile.php5?id=43534&mode=photo&pic_id=3453432#pic[/url] I need the 2 ids. But it doesn't seem to work. [CODE=JSP] var url = "http://www.mysite.com/profile.php5?id=43534&mode=photo&pic_id=3453432#pic"; var exp = new RegExp("^http:\/\/w?w?w?\.?mysite\.com\/profile\.php.?\?id=(\d+)&mode=photo&pic_id=(\d+).*?$"); if (exp.test(url)) { var found = exp.exec(url); alert("found0: "+found[0]+" found1: "+found[1]); } [/CODE] What am I doing wrong ? …

Member Avatar for Karas87
0
146
Member Avatar for Caled

Hello, Im not quite sure If I'm posting this in the right category. Briefly the problem is: I'm developing this web application using MVC approach that based on Java and JSP. I have created the servlet which use the DispatchRequest to forward the request-response. In my JSP, I use the …

Member Avatar for peter_budo
0
58
Member Avatar for goyofoyo

i am working with a piglatin translator that has a GUI but i am stuck on how to make it translate when i you push the translate button here is my GUI what is in red is were the error occurs if someone could help i would appreciate it thanks …

Member Avatar for Ezzaral
0
296
Member Avatar for nanna

hi, Iam trying to add names and numbers to a database then save them by updating them. i run my program, but when i press any button nothing happens????? pls help me, i do not know where is the problem in my program???? [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import …

Member Avatar for nanna
0
327
Member Avatar for shahab.burki

Hi, I am stuck in implementing the linked list in Java. I am using three classes to construct Liked List. One is Data Class (for holding Node's Data), Node Class (which encapsulates the Node properties) and a Linked List Class. Though it creates a successful linked list, but when I …

Member Avatar for BestJewSinceJC
0
153
Member Avatar for thijo

[B]hi, i'm coding to take a input vector inputdata, and continuously find standard deviation to count how many distinct data ar available.for this i implement a small method called findk().[/B][code =java] public int findk(Vector inputdata ,double minSD) { inputdata=new Vector(); double tolerance=0.001,thisSD; Collections.sort(inputdata); if(minSD<0.0) this.minSD =inputdata.getStandardDeviation(); inputdata d1= getHalf(1,inputdata); inputdata …

Member Avatar for BestJewSinceJC
0
98
Member Avatar for koolhoney07

hiiii is their any special functin available to calculate the execution time of a program written in java.?? thanks in advance..

Member Avatar for verruckt24
0
79
Member Avatar for chetan08_01_87

hi, I have an application that plays video files using jmf It plays some videos but without audio but while playing some videos the application automaticaly terminates and generates runtime error. A log file is created by name hs_err_pid2232.log which have following message: # # An unexpected error has been …

0
60
Member Avatar for khalidmehmood

Hi Experts! I am developing a online shopping module I am new to JSP. I have develop the interface as under for one product: Product Name Manufacturer Stock Quantity Price <Input text field to input quantity to purchase> hyperlink Buy Here that pass the parameters product ID, product name, price …

0
93
Member Avatar for darkagn

Hi all, I am trying to make a simple game of Craps in Java. My idea was to have a JFrame with an image of the Craps betting table as the background image and when the player clicks on a section of the table they can place or remove a …

Member Avatar for darkagn
0
173
Member Avatar for AirmanTheGreat

OK. So this program is supposed to prompt the user whether they want to play the guessing game. If they say no then end the program otherwise it will start the game and ask them for their first name, last name and the number of guesses they want. Then it …

Member Avatar for AirmanTheGreat
0
101
Member Avatar for digital_dizasta

I need help in writing a simulated annealing algorithm that is able to maximize f(x)=sin(0.15*x)+cos(x) defined on the interval 0<= x <= 40 using the cooling schedule. Please help me as i'm supposed to generate random numbers between 0 and 40 and substitute in f(x)=sin(0.15*x)+cos(x)...... thanks

Member Avatar for verruckt24
0
115
Member Avatar for gabec94

I am writing a box program, with various extras. I understand that proper coding requires properties to be private, but I now need to add to this program getTotalEdgeLength, getSurfaceArea, and getVolume methods. Would I put these methods in the main class? I do not know a way to only …

Member Avatar for gabec94
0
107
Member Avatar for herms14

[CODE] 1 // Fig. 29.24: RegexMatches.java 2 / Demonstrating Classes Pattern and Matcher. 3 import java.util.regex.Matcher; 4 import java.util.regex.Pattern; 5 6 public class RegexMatches 7 { 8 public static void main( String args[] ) 9 { 10 // create regular expression 11 Pattern expression = 12 Pattern.compile( "J.*\\d[0-35-9]- \\d\\d-\\d\\d" ); …

Member Avatar for herms14
0
101
Member Avatar for denniskhor

[CODE] if(e.getSource()==btn1) { paragraph=txtAreaArticle.getText(); if (paragraph == "\n\n") { return 1 && countPara+1; txtField1.setText(countPara); } } [/CODE] i wan set count how many paragraph for a article in my textArea. Then the number of paragraph will display on textfield. any one can help me?

Member Avatar for Ezzaral
0
868
Member Avatar for amar4java

Hi everyone im new to this forum and this is myfirst post so excuse me for any mistakes Im doing a final year project on banking i want help to move further basically im designed a jsp webpage in which the form has a selecttio list or drop down list …

Member Avatar for javaAddict
0
66
Member Avatar for rlaknar

I am trying to develop pages in JSP for e-mail.I have created login page and other pages.Now after the user authentication is finished and I need to send the user name to retrieve mails.I heard sessions can be used.I don't know anything about session creation and passing attributes of a …

Member Avatar for verruckt24
0
95
Member Avatar for ba50339

Hi, experts: How to assign a value to each choice in a checkbox, e.g. checkbox:apple;banana;pear. After I checked apple and pear, I can assign them values 1 and 3.Then these two values are sent to another jsp page, so that I can use the values in the new jsp page. …

Member Avatar for almostbob
0
105
Member Avatar for peedi

Hello im kinda of new to java and i am stuck on a program. I want to take a word as input and display it in reverse. ex - hello to olleh I tried to do the For loop but i am kinda of stuck. Can anyone please help me! …

Member Avatar for rameshrajamani
0
5K
Member Avatar for umshere

i am developing one application in which i should control the client monitor from server . so i am wondering java will provide anything to control the monitor display . if you can show some light on this topic plese help me.

Member Avatar for verruckt24
0
39
Member Avatar for damu

I want to access search web services. For that i am having SDK file in ".java" file format. If i compile and run those files from command prompt i am getting result. But i want to achive this through browser. Is there any way to compile and run from browser?. …

Member Avatar for rameshrajamani
0
140
Member Avatar for tuse

Hi, I am trying to implement a client server wherein the client must be able to download a requested file off the server and upload a file onto the server. I have implemented the download part of the code using TCP Sockets. In the upload part from the client to …

Member Avatar for JamesCherrill
0
95
Member Avatar for siddick
Member Avatar for denniskhor

[code] import javax.swing.*; import java.awt.*; import java.util.*; import java.awt.event.*; import java.io.*; public class PartOfSpeech extends JFrame implements ActionListener { private JButton btn1,btn2; private JTextArea txtAreaArticle; private JTextField txtField1,txtField2,txtField3; private JMenuBar jmb; private JMenu fileMenu; private JMenuItem out; public PartOfSpeech() { setTitle("PART OF SPEECH SYSTEM"); Container con=getContentPane(); con.setLayout(new BorderLayout()); jmb=new JMenuBar(); …

Member Avatar for denniskhor
0
80
Member Avatar for redZERO

Hi, i'm making a class which runs on a different thread to the main class. I want this thread class to listen for keyboard events and then I will have specific action from there. The thing is, I don't know how to even start. I read that setFocus can only …

Member Avatar for Ezzaral
0
83
Member Avatar for jhonny_86

Hey! My problem is that I can't modify the "File name" label / text field programatically where you write the file name of your file in the JFileChooser. If I want to have "Write your file" written in the file name (by default) field how would I manage to do …

Member Avatar for jhonny_86
0
126
Member Avatar for hell_tej

I need some help about how to connect MS Access database in NetBeans.I visited [url]www.netbeans.org[/url] but didnt got much help related to MS Access. What I did is I start from Net Beans Desktop Application ....But when i select the option of database in it ....It asks Database URL....I have …

Member Avatar for hell_tej
0
203
Member Avatar for redZERO

I was wondering do all programs have a unnamed thread by default? For example, if i have a very basic program, can i put Thread.sleep(int) anywhere in it and it will make the program sleep for a set amount of time?

Member Avatar for redZERO
0
102
Member Avatar for Monalisaparker

hello friends I want to gain some knowledge on java. could you help me in reffering some good e-books. Also let me know what is the best IDE to be used for java? thanks in advance.

Member Avatar for peter_budo
0
99
Member Avatar for mnvsriram

If my application server(weblogic) is running in windows and If I try to view one of the JSP file which prints a lot of html data generated in the server side, I am not facng any delay. i.e in the JSP I have the following lines of code. <% String …

Member Avatar for masijade
0
94
Member Avatar for oldSoftDev

I am trying to figure out how to read a multi line txt file with a data like ranking, athlete name and Athletic sports name with two different year records like 2007 and 2008 like 1. JOHN CARTER in Sprint Race 19. JOHN CARTER in Sprint Race I am trying …

Member Avatar for oldSoftDev
0
113
Member Avatar for rinky_gupta

i am trying to give a authenticated login and password to java programme..but still there is some problems occur...how can i do this

Member Avatar for verruckt24
0
64
Member Avatar for ezkonekgal

I have a problem: 1.) How do you insert a sequence of integers into a binary tree? does anybody have an algorithm for it? like input : 1, 5, 3, 4 ,2 binary tree: 1 5 3 4 2

Member Avatar for verruckt24
0
381
Member Avatar for ceyesuma

[I] Name: The name of this question is rookie_question_System.out.println [/I] [ICODE] Hello and Thank you in advance for any assistance. [/ICODE] [U] [B] Purpose: [/B] [/U] [B] The purpose of this code is figure the best way to get values of variables as they are changing(simplest way). [/B] [U] [B] …

Member Avatar for verruckt24
0
76
Member Avatar for justluck

Hi, anyone knows how to use java jmf to get the client side screen resolution? The server and client are setup already but i just dunno how to automatically get the client's screen resolution. Thanks !

0
43
Member Avatar for srs_grp

I have 3 tables . the tables are connected with Foreign keys I want to delete some records but as they are interconnected by foreign keys i have to delete all of the dependencies. how to do this?

Member Avatar for masijade
0
102
Member Avatar for jaiprakash15

Dear Friends, I am working on a project where i have a JSP page(ex1.jsp) and in that JSP page i have 2 frames((ex2.jsp on top) and (ex3.jsp in bottom))...When ex1.jsp is called..it has to load ex2.jsp frame and ex3.jsp by passing some paramenters to it.. Please see the code.. [code] …

Member Avatar for jaiprakash15
0
472
Member Avatar for tksrules

Hi, I have written the following code.I need to convert it to GUI. import java.awt.*; import java.applet.*; import java.awt.event.*; public class CompString{ public static void main(String[] args) { System.out.println("Enter two strings:"); BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter first string:"); String str1 = bf.readLine(); System.out.println("Please enter second string:"); String …

Member Avatar for BestJewSinceJC
0
140
Member Avatar for peedi

when i run a program, and try to type in a decimal as input i always get an error? what can be the problem? should i use int or double? help!

Member Avatar for BestJewSinceJC
0
3K
Member Avatar for javaxprogrammer

Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this. [icode]<img src="image.jsp?imgID=112" width="150" heigth="130" border="0">[/icode] I am also …

0
55
Member Avatar for peanutmeister

I don't know what's wrong with the following code. I keep getting the error: ']' expected Why can't I use boardsquare[k] and set it equal it to a graphic? What am I doing wrong? Thank you so much for your time and suggestions! [code] int k = 9; Piece[] boardSquare …

Member Avatar for verruckt24
0
86
Member Avatar for disaster

Hi all, Im fairly (very) new to coding. now I have this school project I need to do for IT which is due tonight. Basicly what I have to do is count the amount of words and letters in a string using what we know, which is not much... What …

Member Avatar for verruckt24
0
126
Member Avatar for weblover

hi all..i have a question ..and need help please... i have this applet code and i don't know how to use applets ....so i want to put this code in a single class if it can be made..coz i don't know anything about applets...and i want to join it with …

Member Avatar for weblover
0
151
Member Avatar for jacline

Add an interface, SizeComparable, that includes only the boolean isBiggerThan( Shape other) method. In your ShapeSet class, provide a method void sort(), that sorts the shapes of the shape set by class Shape implementing the SizeComparable interface. This is the problem I wrote codes but it gives run-time error.Could you …

Member Avatar for jacline
0
212
Member Avatar for akshay.sulakhe

hello friends...started to learn python and have covered the basic stuff and some silly gui stuff...i currently have some time so i thought why not prepare a app in python with some killer gui..now java has swing which can be modified to make such GUI...so is there anything which can …

Member Avatar for scru
0
130

The End.