36,051 Topics

Member Avatar for
Member Avatar for Benjamin_4

Please how can i insert into two different tables in mysql using java. i tried this and its only for one table. so how can i insert into branches and items table simultaneously in the same code? try{ String sql = "Insert into asset_update (Date_Acquired,Item_Code,Serial_Number,Cost_Of_Acquisition,Estimated_Useful_Life,Depreciation_Start_Date,User,Status,Disposal_Date)values (?,?,?,?,?,?,?,?,?)"; pst=conn.prepareStatement(sql); pst.setString(1, ((JTextField)date_aquired.getDateEditor().getUiComponent()).getText()); String …

Member Avatar for Benjamin_4
0
3K
Member Avatar for SAM2012
Member Avatar for masijade
0
92
Member Avatar for munchlaxxx

I'm trying to make a Palindrome program and this loop is giving me trouble: for (int i= 0; i < 79; i++) { character[i] = scan.next(); if (character[i] == ".") {break; } } The user enters a word, and when they are done, they enter a period, which is supposed …

Member Avatar for jwenting
0
289
Member Avatar for jmartzr1

Hey everyone, I'm doing a practice problem and I'm stuck. The question is "Given an array a of n numbers (say doubles), consider the problem of computing the average of the first i numbers, for i ranging from 0 to n-1. That is, compute the array b of length n, …

Member Avatar for JamesCherrill
0
235
Member Avatar for djslavens

Hi there! I am new to the Daniwewb forum, and I was wondering if there was a forum or section specifically dedicated to promotions of books, ebooks, and articles on Java Programming. If you could please send me a link to get me pointed in the right direction or just …

Member Avatar for JamesCherrill
0
68
Member Avatar for Seswing142

Our program must create a guessing game that asks the user what the range they want to game to be and how many guesses they want. Once that is done it askes the user to make a guess and based on the guess its supposed to say Hot if it …

Member Avatar for stultuske
0
514
Member Avatar for RaigaX9

Hello everyone, I'm having some issues with my rock, paper, scissors JApplet program. Of course I have it "extends Applets" from the beginning of my class and I realized that this wasn't the same as JApplet. After I changed "Applet" to "JApplet", when I ran it, it doesn't look like …

Member Avatar for mic0280
0
577
Member Avatar for Nawaf15

Hi, I am trying to write an application that will calculate the volume of a pool with fixed length and width. The user will be prompted to enter 2 values for depth. The application should draw a cross-section of the pool using length, deep end and shallow end. A part …

Member Avatar for JamesCherrill
0
183
Member Avatar for qwerty14444444

pls help me with my codes, age doesn't appear on the text file and i got end of file error when i click "view" button. can someone kind enough to fix this..god bless and more power =) my code >>>>>> http://www.2shared.com/file/8whfrcUJ/Frame1.html

Member Avatar for JamesCherrill
0
292
Member Avatar for cakka

Hello, I got this question from my quiz : > Consider the following code (assume that comments are replaced with real code that works as specified): public class TestExceptions { static void e() { // Might cause any of the following unchecked exceptions to be // thrown: // Ex1, Ex2, …

Member Avatar for JamesCherrill
0
307
Member Avatar for lena1990

hi all i want to create a program that each thread will be handle a part of the log file and read from it at the same time ?? Thanks in advance

Member Avatar for lena1990
0
132
Member Avatar for kay19

Hello. Nearly finish this project, but can't sort the last code. I have faculty, staff, & partime employees, and they have ID, and what I want to do is sort by ascending order them based on their #ID. Everything else works before that. Here is my two codes, the Tester, …

Member Avatar for kay19
0
161
Member Avatar for TheAustinG

For my beginner Java class I am writing a program that will read data from inData.txt and write output to the file outData.txt. I have 5 errors that all say a symbol cannot be found but I'm not sure what exactly it's talking about or what is wrong. The error: …

Member Avatar for TheAustinG
0
340
Member Avatar for murali2489

Hi All, I have completed learning core Java and I want to move to next level in Java Study. I am really confused on what topic to cover next in JAVA . And I also don't know what are all the major topics in JAVA to study after Core Java. …

Member Avatar for murali2489
0
212
Member Avatar for thewayoftheduck

**Question** You are to design and implement a GUI application that will calculate the price of a pizza, based upon the size, style of crust, and selection of toppings. The price is calculated according to the following rules: • A plain small pizza is $6, medium is $8, large is …

Member Avatar for jwenting
0
3K
Member Avatar for F_1

// CS 1063 Project 1: Print Text Patterns The Patterns Class Objectives This is one of three major programming projects this semester. You may NOT collaborate on this project. While you may ask for assistance in debugging, this project should be ENTIRELY your own work. [EDITED BY ADMIN ON COPYRIGHT …

Member Avatar for jwenting
-2
319
Member Avatar for Fatima_110

This code is supposed to determine for a number of random numbers whether its odd, even , prime. At the end all random numbers should be displayed and the prime ones together with the number of odd and even numbers and their %. The part of the code to determine …

Member Avatar for jwenting
0
303
Member Avatar for N841990

how do we use barcode scanner scanned data in our java program .is there any class which can help me.

Member Avatar for straw77berry
0
474
Member Avatar for AndroidUser

Hello, My objective is to create a text file in an android file system. I have looked into the appropriate packages and methods for creating a file. But I am still looking for information about how to access the internal directory structure in order to create a file on an …

0
63
Member Avatar for Aarowaim

Hello everyone, I'm an amateur programmer, and I am working on a program to help me practice my mental math. The essence of this program is that the user inputs an expression which will be the form of each question. Their goal is to solve those expressions as fast as …

Member Avatar for gusano79
0
260
Member Avatar for lena1990

hi all i want to create a pie chart but i get an excepion i will print the code and the exception i will be greatful for any help DefaultPieDataset pie1=new DefaultPieDataset(); pie1.setValue("Section 1", 46); pie1.setValue("Section 2", 56); pie1.setValue("Section 3", 43); pie1.setValue("Section 4", 11); JFreeChart chart=ChartFactory.createPieChart("Log ID chart", pie1, true, …

Member Avatar for lena1990
0
339
Member Avatar for wallet123

Hello! i need to filter the searched data in the database sql and display it on the table. But i keep on getting tis error: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.charAt(Unknown Source) at app.SearchByKey.SearchStudentNumber.SearchStudentRecordReader(SearchStudentNumber.java:38) at app.ui.ListOfStudents.updateSearchTable(ListOfStudents.java:159) at app.ui.ListOfStudents$3.keyReleased(ListOfStudents.java:105) at java.awt.Component.processKeyEvent(Unknown Source) at javax.swing.JComponent.processKeyEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) …

Member Avatar for JamesCherrill
0
433
Member Avatar for java_programmer

I have a question - how mwmory is allocated when any data structure is declared? Suppose I have declared a list as follows - List<Integer> lst = new ArrayList<Integer>(); How many bytes will be allocated for that variable or initially no memory will be allocated? Memory will be allocated when …

Member Avatar for jessicarobort
0
248
Member Avatar for faisal6621

I want to work on an antivirus software program. But, what should I know first to dig?

Member Avatar for JamesCherrill
0
742
Member Avatar for abinmathews

hey i want to create two *buttons* namely** submit** and **update** button in one page,but i need to knw wheather both the actions of the button can be performed in the same page or in diffrent page,if it is to be performed in diffrent page,how do i do it??

Member Avatar for stultuske
0
271
Member Avatar for iTechnnn

My assaigment was: Suppose we are working for an online service that provides a bulletin board for its users. We would like to give our users the option of filtering out profanity. Suppose we consider the words cat, dog and llama to be profane. Write a program that reads a …

Member Avatar for masijade
0
518
Member Avatar for dharmatej.m

Write Java program that generates the Fibonacci sequence in the child process. The number of the sequence will be provided in the command line. For example if 10 is provided, the fibonacci numbers less than 10 will be output by the child process. Because the parent and the child processes …

Member Avatar for stultuske
-1
230
Member Avatar for Petranilla

Hi, Having some issues connecting to MS Access Database. I think its ot connecting to the database. Below are the source codes: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class DB extends DBDriver implements ActionListener { JFrame f; JLabel Fname = new JLabel("First Name: "); JLabel Lname = new JLabel("Last …

Member Avatar for Petranilla
0
346
Member Avatar for Louie_Rave

Hello everyone. I'm currently exploring Java's GUI and trying a lot of codes now. I found a game GUI source code on the net. This program uses images to properly run. I can run the program now but it only displays black screen. It already have the folder for the …

Member Avatar for Louie_Rave
0
256
Member Avatar for mitalawachat

I want to develop **JavaFX/Java AUTOMATIC CODE GENERATOR**. I need algorithm or sample program. If anyone can help please mail solution to <snip> *DaniWeb Rules include: Do not ask anyone (member or moderator) for help by email or private message*

Member Avatar for stultuske
-1
45
Member Avatar for kylealb007

package guessinggame; import java.awt.FlowLayout; import java.awt.Color; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JTextField; //create class GuessingGame that extends to JFrame public class GuessingGame extends JFrame { public static void main(String args[]) { //define variables private JLabel instruction1JLabel; private JLabel instruction2JLabel; private JLabel instruction3JLabel; private JLabel …

Member Avatar for JamesCherrill
0
165
Member Avatar for manel1989

hi every one! i have 2 applications one on eclipse and the other on VS2010C++, so i want to send parameters from the java code to the other, i just konw how to execute the c++ code from the java code. what i want is this : send paramters from …

Member Avatar for manel1989
0
324
Member Avatar for caswimmer2011

Hey all! I am in college doing a speech on programming and one of my topics is to explain the difference between Java, C, and Objective C. I have been programming with Java for 3 years now and just started with C last month, but I don't know the differences …

Member Avatar for Dani
0
458
Member Avatar for Stein102

Can anyone recommend me a good Data Structure and Algorithm book for java programmers? Possibly intended for game development, but not required to be. Thanks.

Member Avatar for prakash.seetharaman
0
115
Member Avatar for lena1990

hi all i have log file with size over 45GB and more than 110 million lines and it is stored in server i want to read the file from the server and insert it to an oracle database in another server but it takes along time so is there is …

Member Avatar for JamesCherrill
0
190
Member Avatar for YumnaZia

this is my code, the only problem I'm facing is that the jseperator is not appearing! import java.awt.event.*; import java.util.*; import javax.swing.*; import java.awt.*; public class AdmForm extends JFrame{ Container con1= getContentPane(); Container con2=getContentPane(); JFrame f2= new JFrame(); JButton b1= new JButton("Click me!"); JSeparator sep= new JSeparator(SwingConstants.HORIZONTAL); AdmForm(){ setSize(300,300); setLayout(null); …

Member Avatar for JamesCherrill
0
127
Member Avatar for student_learner

We want to make a row of bricks that is X meter long. We have a number of small bricks (Y meter each) and big bricks (Z meter each). Return true if it is possible to make the X meter long row by using a combination of the two kinds …

Member Avatar for JamesCherrill
-1
110
Member Avatar for Nautical.RB

Hello daniweb community i'm new here and glad to join this amazing website. Well want I need to understand is how I learn to become a competent computer science major and learn to write code very well. I have always had a knack for this and I love it alot …

Member Avatar for phorce
0
382
Member Avatar for kay19

Hello, having a hard time using my Faculty class, where I have to initialize/createObject from my Education class to Faculty. I would like to use the constructors from the Education class, to be implemented to my Faculty class. Here is my attempt Here's my two codes. public class Education { …

Member Avatar for JamesCherrill
0
320
Member Avatar for stanislav.koshutin

Please help to complete beginner in programming. I work with binary stack of 2 pictures and here is the plugin I use: import ij.*; import ij.plugin.filter.PlugInFilter; import ij.process.*; import java.awt.*; protected ImageStack stack; public int setup(String arg, ImagePlus imp) { stack =imp.getStack(); return DOES_8G+STACK_REQUIRED; } public void run(ImageProcessor ip) { …

Member Avatar for JamesCherrill
0
236
Member Avatar for yi625

con = Connect.ConnectDB(); String sql = "insert into table1 (" +"StudentID," +"FirstName," +"LastName," +"Contact Number," +"E-mail address," +"CarNumber)" + "values("+txtid.getText()+ ",'"+txtname.getText()+"','"+txtlast.getText()+"','"+txtnumber.getText()+"','"+txtemail.getText()+"','"+txtcarno.getText()+"')" ; try{ pst = con.prepareStatement(sql); pst.execute(); JOptionPane.showMessageDialog(null, "Saved"); } catch(Exception e){ JOptionPane.showMessageDialog(null, e); } can any one help me with this? im getting syntax error in insert into statement …

Member Avatar for silvercats
0
835
Member Avatar for vijaykumar_b

I hava created one table with columns in html in which i had customername and some columns, now myrequirement is when i click on any customer name of the customerName column from my created table i want to get particular customer details in new jsp page plz help me,Thanks in …

Member Avatar for silvercats
0
121
Member Avatar for Hanamantagouda
Member Avatar for xXFalcoPunchXX

I need help in building a binary tree and putting integers in it. I need to write an add method in my MyArrayBinaryTree class (that extends ArrayBinaryTree) that allows me to place the element to be added in the very next available slot in the array. I also need to …

Member Avatar for JamesCherrill
0
365
Member Avatar for rajeshwarreddyt

Hi Folks, I want to use windows authentication for java application for eaxmple: I have a application called ABC , now i want to apply windows authentication for this ABC appliation like when user hit the application URL the user should login automatically with out prompting any user name and …

Member Avatar for stultuske
0
1K
Member Avatar for techxaidz

I am currently having difficulty in testing a condition if a certain button do not have a text on it. For example i have a button in an array named btn[] and a textview(JLabel) named "tv", if i execute this code, nothing happened. if(btn[1].getText().toString().isEmpty()){ tv.setText("Okay"); } i also tried these …

Member Avatar for stultuske
0
171
Member Avatar for Seswing142

I am supposed to get the first and the last word from a string that is input by a user but im not sure how. Any tips would be great! //Print the first word and last word from a string int index = inputString.indexOf(" "); String fistString = inputString.substring(0, index); …

Member Avatar for stultuske
0
8K
Member Avatar for irtza

This program takes a number from the user and then using loop, modulo and division operator split the number into digits. as: import java.util.Scanner; class Split_num { public static void main ( String [] args) { Scanner a = new Scanner (System.in); int num, n, r; System.out.print ("Enter a number: …

Member Avatar for jwenting
0
619
Member Avatar for NajwaMY

I want to enter a data from the text field to my database named project marking. When I compile the java program seems there's no errors but when I click on the Calculate Button the data won't enter into the database. This is the partial code I didn't finished it …

Member Avatar for JamesCherrill
0
194
Member Avatar for android_gl

how to test if a num is a square root? ex: 9 is square root 3 is not square root ///////////////////////////////////////////// //do not worry about sytax. int x = 0; //always start at 0 int y = 101010; //is this a square root? square(x, y){ if((x*x) >= y){ //not a …

Member Avatar for cwarn23
0
327

The End.