36,051 Topics

Member Avatar for
Member Avatar for new_2_java

Hi all, I am trying to execute a windows command from within my java program, but I can't get it to execute the DOS command. Here's my code: [code=java] try { Process p = Runtime.getRuntime().exec("cmd.exe /C cls"); } catch (IOException e) { // catch exception } [/code] But, the code …

Member Avatar for nomemory
0
192
Member Avatar for Trekk

I'm new to programming and i'm way out in left field on this one... I'm trying to write a program that takes takes numerical grade inputs and tells you what the letter grade is. The program must keep running until the user hits 'E' or 'e'. Here's my problem: with …

Member Avatar for BestJewSinceJC
1
118
Member Avatar for ryno365

Hello DaniWeb. Just brushing up on some Java and got a quick syntax question. What does the this code do? [CODE]LoginForm formBean = (LoginForm)form;[/CODE] Now I know that a formBean object of type LoginForm is being created but I dont know what its being declared with. Whats happening on the …

Member Avatar for quuba
0
117
Member Avatar for Moein.Enayati

Hi I want to create a simple bi-directional variable binding in java. assume having a String and a jTextField [CODE=java] String stringVariable; JTextField jTextField; [/CODE] I bound the jTextField.text property to the stringVariable using this code : [CODE=java] org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${stringVariable}"), jTextField, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); bindingGroup.bind(); [/CODE] any …

Member Avatar for ~s.o.s~
0
619
Member Avatar for sandeepgrandhi

hi, please tell me how can i open a dynamic web project in netbeans and then open a JSP and Servlet files. Thanks

Member Avatar for peter_budo
0
32
Member Avatar for feartrich

[code=java] import java.util.*; public class factorial { public static void main(String[]args) { int m,f,n; System.out.println("Factorial Solver"); System.out.println("Enter a number"); Scanner sc = new Scanner(System.in); n = sc.nextInt(); m = 1; f = 1; f = f * m; while (m != n) { m = m + 1; } f …

Member Avatar for nomemory
0
99
Member Avatar for Ashwin Vasnai

I want to create a Jtree in Java Desktop Application.I know how to create a dyanamic Jtree in normal java application.I tried google but I didnt got satisfied answer.please help me as soon as possible. Also the Tree is of "Name of tables in database" and with child node as …

Member Avatar for quuba
0
136
Member Avatar for axelle.eichner

Hey, I'm a student wanting help on how to write a program in netbeans.. I have no idea how to work this website so this question may be in the wrong place but.. here goes: so i need to write a program that outputs a quote one letter at a …

Member Avatar for javed123
0
148
Member Avatar for hackmein

create a class (adressbookentry)that contains adress book entry using java code...

Member Avatar for ithelp
0
30
Member Avatar for Smoking Bros

Well, the title might be very complicated if you think of what I'm actually trying to do. Well I have a typical 'the-sky-is-falling' game and as in most of these type of games you have to catch apples, and I maximum allows 3 at a time, and you get + …

Member Avatar for Smoking Bros
0
130
Member Avatar for gitech

Hai Friends, Iam developing casino and spinning game in J2me with grphics, can any one suggest me what tool i have to use how to use?

Member Avatar for peter_budo
0
92
Member Avatar for DemonixXV2

When I try running this code in netbeans, I get a window which says that the main class wasn't found in PerfectNumbers. And underneath there's a select main class, which endlessly stays at : Initializing view, please wait... [CODE]public class PerfectNumbers { int nbToFound; public PerfectNumbers(int nb) { nbToFound = …

Member Avatar for DemonixXV2
0
3K
Member Avatar for redrocket0274

Can someone tell me what's wrong with my program? import java.util.Scanner; public class TotalSales { public void getNumbers() { Scanner input = new Scanner( System.in ); double numbers[][] = new double[5][5]; int count = 0; // number of uniques read int x = 0; int y = 0; int productNum …

Member Avatar for VernonDozier
0
107
Member Avatar for DemonixXV2

Ok, I've got this code, it says that there are no main classes and that [I]public class Amicable[/I]; class Amicable is public, should be declared in a file named Amicable.java, but the file name is Amicable... Any help would greatly help me, since I have same prob. with another file>_> …

Member Avatar for DemonixXV2
0
146
Member Avatar for kahaj

I'm using documentation on sun.com to try and learn Java. I was trying a simple Notepad type program but cannot get the menus to display. I'm receiving no errors and cannot figure out what I've done wrong and/or left out. [code] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class NotepadInJava …

Member Avatar for majestic0110
0
237
Member Avatar for KirkPatrick

Its been awhile since I have toyed around with java, so I'm a bit rusty. But decided to mess with it today. I have a jPanel that I will be adding objects to, but I want to add the in a new row each time a button is clicked. Anyways …

Member Avatar for KirkPatrick
0
123
Member Avatar for Xamas

I need to build a program - hotel, which has from 1 to XXX rooms. It is ok, when I have only the: [CODE=JAVA]private static int[] array_of_rooms; <... CLASS CONSTRUCTOR ...> array_of_rooms = new int[size]; // Size is defined size, of rooms in the hotel. // Fill default room status …

Member Avatar for VernonDozier
0
2K
Member Avatar for jrosh

I want to trigger an event when ever an item is changed in a combo box...how can i do it? what is the listener & action? thnkx in advance.....

Member Avatar for majestic0110
0
277
Member Avatar for peter_budo

I need to read XML document submitted to doPost() method ( I do not want to upload it, just read in and pass for further processing). Here is a general code that I use for now to see if file been received. [code=Java] public void doPost(HttpServletRequest request, HttpServletResponse response) throws …

Member Avatar for peter_budo
1
154
Member Avatar for gururajb

How to create n threads for manipulating m files ('n' is very less compared to file 'm') . I have written file manipulation program in void run and reading in main prog. declaring file name in global variable buffer I should use file locking . Currently i have written program …

Member Avatar for JamesCherrill
0
67
Member Avatar for engg_kavi

hi friends... i have a doubt in insert query... how to write the insert query to insert the value from textfield into database table.......

Member Avatar for javaAddict
0
112
Member Avatar for einjelle

This is really frustrating. Whenever I run this, a blank window frame appears The components only appear when I click the edge of the frame. Please check if I did something wrong: [CODE] import javax.swing.*; import java.awt.*; /** * */ public class FFGen{ public void First(){ /** * @param args …

Member Avatar for einjelle
0
246
Member Avatar for deeptharamesh

hi pple.... i am doin a mini proj and can anyone please help me the java code of the ad-hoc on distance vector routing algorithm.....

0
55
Member Avatar for nazd28

hi im getting an error wen i give this syntax in order to retrieve info from my db into a txt box <input type="text" name="tname" <%out.println(rs.getString(1));%>/> pls help

Member Avatar for nazd28
0
158
Member Avatar for shruti_kapate

which of the following is correct 1)block can have multiple records 2)records can have multiple blocks 3)one record per block 4)both are independent

Member Avatar for shruti_kapate
0
42
Member Avatar for Hanyouslayer

First, I want to thank you for helping if you did, if not, thanks for checking it anyway. Second, I have been working on this for awhile, but I only am getting baby steps towards my goal. I get this far and I get compile correctly, but when I run …

Member Avatar for Dougnukem
1
173
Member Avatar for priya ravi

sir, i have got to present a seminar on java the topic being java and virus , my sir has asked me to create a program using java for virus can u please help me. i am a second year student for bachelor if computer applications. your faithfully priya ravi

Member Avatar for javaAddict
0
47
Member Avatar for umasparow

how to convert jpeg color image to gray by using formula 0.3 * red + 0.6 * green + 0.1 *blue

Member Avatar for quuba
0
52
Member Avatar for hny_lyn

To begin, we were asked to make a TREE... It says that we should traverse the left subtree of the ROOT/NODE in postorder and then make a copy of it... Next is to traverse the right subtree of the ROOT/NODE in postorder and then make a copy of it... Lastly, …

Member Avatar for quuba
0
533
Member Avatar for dskanth

Iam using JXTaskPane, and added few taskpanes, to a taskpanecontainer, and inturn added it to a panel. I want to apply action listeners to the taskpane selected. But i see that there is no methos like getSelectedComponent for a taskpane, which exists for a tabbed pane. How i can achieve …

Member Avatar for dskanth
0
72
Member Avatar for deepak.marur

Hi all, I've a curious problem with jni invocation. The explanation follows.. I have two pieces of code...a test stub, which is basically a stand alone java program and another the same code integrated into a component (the main function replaced by a static function). The code makes a jni …

0
86
Member Avatar for nazd28

Hi i hve used the syntax provided by ul in order to del multiple rows using checkboxes but for some reason the code shows we an error wen i give the value of the checkbox as one of my feilds so that i cud del the rec on that bases. …

0
80
Member Avatar for rajuchacha007

Hi all, I would like to know whether there any JAVA API exists which does copying, deleting or moving files from and to directories and which is platform independent. I mean consider 3 layers. Last one is of OS (windows, linux, unix, solaris). Middle one is of JAVA API and …

Member Avatar for nomemory
0
150
Member Avatar for packmule

Hi, I am just trying to figure out how to access some data. Currently it is stored in a spread sheet in the following form........ [CODE] 8/11/09 9/12/09 .... mm/dd/yy name score score .... score name2 score score .... score [/CODE] there will be many names (and more may be …

Member Avatar for VernonDozier
0
123
Member Avatar for leverin4

I'm running into an issue with a program. I need a method that takes a string and returns every possible combination of upper and lower case letters for that string. For instance, cat would return: cat caT cAt cAT Cat CaT CAt CAT The string entered could be any length …

Member Avatar for nomemory
0
795
Member Avatar for timon_zed

Hello good citizens, Am trying to implement a simple web based shopping system, however I want to find out if there is a way in which i can reduce the quantity of goods in stock after customer buys just by using servlets without me having to go to the database …

Member Avatar for timon_zed
0
468
Member Avatar for TryingToDo

1. I have a simple application, which uses a html table to represent the data retrieved from the database. How can I add to each row from the Html Table, a submit button. The button can be something like delete or modify the dates from that specific row, so I …

Member Avatar for TryingToDo
0
127
Member Avatar for gk0110

Hi all, I need to apply the pagination concept in my jsp page. The result set which is used to serve the jsp page is obtained through a dynamic query. Is it possible to apply the pagination concept in this case.. Please advice me .. Is it possible to do …

Member Avatar for ~s.o.s~
0
270
Member Avatar for Fibinacci85

hi thanks for your help in advance, I'm Realy new java in particular to netbeans I'm currently a 2nd year degree student and one of my subjects is Data Structures and Algorithms in java. My assignment requires me to right a program that reads in a file and out puts …

Member Avatar for verruckt24
0
115
Member Avatar for Bloubul

I need help once again. I am new in this course and are still battleling with some of the work. I wrote a code for Displaying Stock Information, however it's giving me a error. Please help? /* Chapter 8: Programming Assignment 9 Programmer: T. du Preez Date: September 20, 2009 …

Member Avatar for VernonDozier
0
167
Member Avatar for Freddie_M

I need help for writing a program that shows a given graph is dag or not ?I want a complete guide about topological sorting code. I found a code in internet but it has a lot of errors. please help me friends. thank you

Member Avatar for ~s.o.s~
0
22
Member Avatar for Elektro
Member Avatar for zinjnhell
Member Avatar for IdolOfIdle

here is my code. it connects to the server successfully.But connect.getContentLength() returns -1; and downloaded file contains zero bytes. any suggestion will be deeply appreciated. [code] try { // Open connection to URL. HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // Specify what portion of file to download. connection.setRequestProperty("Range", "bytes=" + downloaded …

0
46
Member Avatar for timon_zed

Hi there, I have a servlet which is meant to retrieve data from the database by compairing the number entered via a web form. The trouble is that, it only gives me the last record in the database and not any other record. I have 5 records in the database …

Member Avatar for timon_zed
0
143
Member Avatar for pvt_geeker

Hello, JAVA community. I am currently working on developing a system (Hotel Reservation System) as academic work. I am using Netbean IDE 6.7 and MySQL or MS SQL as development tools. I am quite amateur with the use of Netbean, I also find that manual coding is very tedious. So, …

Member Avatar for Ezzaral
0
91
Member Avatar for jrosh

I want to transfer data from mysql database to an msexcel sheet... Is it possible with java. how?

Member Avatar for jrosh
0
121
Member Avatar for ceyesuma

Hello. I was studying the database connectivity tutorial . I set it up with the database in MySQL. However I tried to set it up using Netbeans6.7.1. just to see if I could get it to run. it's not working out. Can this be setup in netbeans? I have attached …

Member Avatar for ceyesuma
0
245
Member Avatar for jmodeveloper

I am using jBoss server . when we are giving print from the client it does it print in client but its get print in the server.. i don't know how to redirect it...so help me... this is the piece of code:: PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet(); printRequestAttributeSet.add(OrientationRequested.PORTRAIT); printRequestAttributeSet.add(MediaSizeName.ISO_A4); PrintServiceAttributeSet …

Member Avatar for ~s.o.s~
0
104
Member Avatar for AjithAnnadurai

Hi friends anyone knows how to convert SIS to JAR file format . please tell me the link for that software . please reply

Member Avatar for David Boon
0
548

The End.