32,204 Topics
| |
I have a problem with serializing an Arraylist. This is my method to serialize Arraylist: public void serializeObj(){ ArrayList<Actor> novylist = new ArrayList<Actor>(); novylist.addAll(components); try { FileOutputStream fileOut = new FileOutputStream("zeditoru.ser"); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(novylist); out.close(); fileOut.close(); }catch(IOException i) { i.printStackTrace(); } } components is Arraylist with theese … | |
how can i make a servlet to validate a form with two file upload one image and other a pdf file. along with the other string parameters like name age gender etc., i need to validate the pdf and image files in servlet and save it in folder of my … | |
| |
Often we're faced with the need to represent primitive data types as readable/writable bytes that can be sent through a data stream. In Java, there are classes such as DataOutputStream/DataInputStream that can do the work for us, but often a programmer wants to manage the conversions himself (or herself, to … | |
Here's my assignment question: > **Develop a Payroll class that consists of two user-defined methods, namely calculateNetPay() and printOutput() methods. The calculateNetPay() method is used to calculate the employee's net pay, as the formula follows: > > Net pay = gross pay - state tax and federal tax > > … | |
i have written following code so far. But now i am stuck with one porblem. I have made a loop that exactly modify Numeric Quasi identifier by one by one. Now problem is: I hv made loop that modifies exactly once,twice and all four Q.I.(Quasi IDentifier) How can i make … | |
Hi, i have two buttons: Add button and Clear button one Jlist 1- when i click on Add button, it will add some data in the jlist. 2- when i click on Clear Button, it will clear perfectly the jlist. but when i re-click on Add button, here it add … | |
Can anyone please tell me how to run the genetic programing examples given in the **Watchmaker Framework library using Net Beans**? I have added all the jar files in a library and added this library to my project.But still I am unable to run the examples. Thankyou ! | |
In this code, I am prompting the user to pick a number from 1-1000 and having the user keep it in his/her head. Then, in 10 tries or less I am trying to have the computer guess the user's number. This is what I have so far... import java.util.*; public … | |
Hi guys, I got a problem with my Programm after adding a new Class in my Tic_Tac_Toe version...I tryed to use a method of the clas KI_Test1 ( which is a very simple "AI"). The class before without static works. After changing everythin in static, because my main method is … | |
Hello guys! I need some help... I'm new in Java programming and I'm dealing with in issue. I'm at a step of my project that keeps stoping me from going further. I have some xml files that contains diacritics and I need to read them and extract the tag's that … | |
Hi everybody. Sorry for the newbie post. I have an assignment I was just looking for some help with. I need to create a dice game that generates a random two dice throw and then gives you three tries to guess the number. I seem to be a bit stuck. … | |
Could someone help java code to read number of lines, words and characrters in paragragh . | |
Hi, I'am creating a single JFrame UI, that uses multiple JPanels (implemented through JTabbedPane). The problem I'am having is aligning the objects within each JPanel. In the first JPanel all of the objects are centrally aligned. I'am unsure of what to do to solve the problem. I have read the … | |
HI I was wondering if you can help me with this random number program. import static java.lang.System.out; import java.util.Scanner; import java.util.Random; class GuessAgain { public static void main(String args[]) { Scanner myScanner = new Scanner(System.in); int numGuesses = 0; int randomNumber = new Random().nextInt(10) + 1; out.println(" ************ "); out.println("Welcome … | |
["Objects that are instances of an inner class exist within an instance of the outer class"](http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html) Even though I attempt to create an independent instantiation of the inner class, the outer class is always there because of the statement above. ##Is that ture? If true, then that would also mean … | |
Hi can you help me please how can i change the color of progressbar or just look like in windows xp progress bar...please help me...thank you in advance hoping for your positive responds... | |
I am trying to get the ItemListener to work on this program. I keep getting an error that says the method getSelectedItem cannont be found and cannot figure out how to fix it. import java.awt.*; import java.awt.event.*; public class Buttons extends Frame implements ActionListener, ItemListener { public Buttons() { //set … | |
How to add css to all jsps in java web project. Is it possible using web.xml ? | |
Hi All I am new to java. I am facing a problem I want to compare a string to a set of strings, For example there is variable string x, If the value String X matches to String A , String B, String C then run the particular code otherwise … | |
Hi I am currently working on a project where I have to find the most frequently occurring word in an imported file. I have imported the file and can display what it says, but Im having trouble with this part: [COLOR="Green"]"Create a Word class that has a string and a … | |
this program is 2 classes and it has 2 JLabels, 2 JTextFileds, and 2 JButtons... it convert temperatures from Fahrenheit to Celsius and from Celsius to Fahrenheit.. Class 1: [code] // Author: Helen Toma import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JTextField; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; … | |
Hi folks.. I had a problem and looking for the answer..The exact question of mine is [this](http://webapps.stackexchange.com/questions/18959/can-i-form-a-direct-url-to-a-particular-gmail-account) Sorry that i dint typed the entire question here but i'm afraid that i may not able to explain well if I type that entire thing. But that was my exact question which … | |
i'm trying to modify a java code. I have a jSpinner where the user have to choose a number like minimum 0 and after this step the user can continue by clicking the OK button and continue his steps... So here what i want is when the user didn't enter … | |
Hi, i try to handle a Neagtive number exception in my code. i tried this but it shows "illegal start of type" why please? Here is my code: public class JPanelTemporal extends javax.swing.JPanel { public JPanelTemporal() { initComponents(); } public void setDuration(int duration){ this.jSpinnerDuration.setValue(duration); } public Time getTime(){ Time time … | |
Hi, I've been given an assignment to write a java program that determines if a random given number is Prime OR not. But we also have to make comments in each lines, explaining the function/purpose of each lines to this java coding. So far, I've gotten the program corrected! All … | |
hi folks,basically i am facing a problem importing a package, dir structure is like src |---com |---example |---model |---BeerExpert.java package com.example.model; import java.util.*; public class BeerExpert { public List getBrands(String color) { //code goes here } } src |---com |---example |---web |---BeerSelect.java now in BeerSelect.java i am importing the BeerSelect … | |
Can anyone help me in my Java assignment ? Due date on 28/11/2012 | |
Hi, I am currently making an assigment for JAVA but I am stuck. I have to make a birthdate from the three parameters: day, month and year, which are numbers = int. With this I have to put in some checks for valid dates. That part I think is done, … | |
Hi there I am reading some java tutorial and a have a question about these 2 classes java.util.Scanner; javax.swing.JOptionPane; In the tutorial I am looking at the 2 classes are used in separate programs to get the input from a user With the first class http://www.homeandlearn.co.uk/java/user_input.html after importing the class … |
The End.