35,618 Topics
![]() | |
I'm having trouble with a switch statement [code=java]Scanner scan = new Scanner (System.in); char chars = scan.nextLine(); System.out.println("A Andorra\n" + "B Belgium\n" + "F Finland\n" + "M Malta\n" + "S Slovenia\n\n" + "Choose a country from menu above:\n" + chars); switch (chars) { case 'A': System.out.println("You chose \"Andorra\""); break; case … | |
Here is my code package prg420.week5; //Creates the package import java.util.*; class Grades { //Creates the class for the variables private double grade1; private double grade2; private double grade3; private double grade4; private double grade5; public void setGrade1(double val) { grade1 = val; } public void setGrade2(double val) { grade2 … | |
Hello All, I really hope that someone can provide some assistance. I have read a XML file into my hashtable. Next I created a second hashtable. If a key is located in my first hashtable, I want that key along with its value to be inserted into the second hashtable. … | |
Hello people, I'm new here and new to java also... My only programming experience is in C, but now I have to do some work in java. First, the problem is: My input is an image file that contains different routes from a source to destination. (I have attached the … | |
I am not sure how to fix this problem. I am trying to pause the display after the first 15 lines until the array ends. /* Week 4 Individual * Programmer: Melissa Snider * Date: 4/6/2008 * Calculate the mortgage payment for 3 loans with an array */ package prg420.week4; … | |
Hi, Could someone point out ways on how I could reload the frame? so far, what I've done : [code]int more = JOptionPane.YES_OPTION; more = JOptionPane.showConfirmDialog(null, "BOOOoooM!!! Would you like to play again?", "", JOptionPane.YES_NO_OPTION); if(more == JOptionPane.YES_OPTION){ myFrame.setVisible(true); } else{ myFrame.setVisible(false); } [/code] I'm not sure what I should … | |
Dear all, How do I validate cell value in jTable ? I want users to input numeric value in cell. Thanks, Kusno | |
Hello, After having a list created from objects of a certain Class. I wish to sort the contents. How do I do this? This is my case: _bkgList = new ArrayList(); for(int i = 0; i<10; i++){ BookingResponse bkngRes = new BookingResponse(); bkngRes.setAwbNum(awbNum); bkngRes.setOrigin(origin); _bkgList.add(bkngRes); } As you can see, … | |
Elo guys, i have trying to develop a client/server application! i'm new with sockets, so i'm trying to learn from existing source codes. I have come accros a piece of code: public static void main(String args[]) { // validate parameters: if (args.length != 2) { System.err.println("Usage: java GameClient <host> <friend_port>"); … | |
Hello I'd like to have a list of ints inside my vector.. I tried to do the following: [CODE]private static Vector<List<int>> getCombMatrix() {[/CODE] But it will give me error: Syntax error on token "int", Dimensions expected after this token However, this works okay: [CODE]private static Vector<int[]> getCombMatrix() {[/CODE] What am … | |
Devlope a Pedel boat class and a Rowing boat class and mark a boat as hired, storing the customer name and time, return a boat's details as a String, including customer name and time of hire if it currently hired out, calculate the amount due on a hired boat, given … | |
Hi All! Im creating a java web application. I am finding a very little information on making forums/blogging/chatting application with java. There is plenty of stuff that uses php/mySQL. Should I learn php, or how to use java to interact with php, or are there tutorial, books or other sources … | |
I want to call a shell script from java.I have searched in many java related web sites but I did not find the correct answer.Can anyone please help me out with this problem. plzzzzzzzzzzzzz thank you!! | |
Hi everyone, I am trying to create a simple website using cookies to remember the last 2 links visited on my site. It is a very simple 2 column website: [code=JSP] <%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.*"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Testing … | |
Hello, The following is background on my assignment "Modify payroll program so that it uses a class to store and retrive the employee's name, hourly rate and the number of hours worked. Use a constructor to initialize the employee information, and a method within that class to calculate the weekly … | |
Hello, I am on Linux Mint and just installed Netbeans to get started with Java programming. I got these errors while starting the IDE for the first time: [url]http://i268.photobucket.com/albums/jj17/Google_Spider/netbeanswarning.png[/url] [url]http://i268.photobucket.com/albums/jj17/Google_Spider/netbeanswarning1.png[/url] I don't know what these errors mean. When I started the IDE for the second time, I got no errors. … | |
Hi every one...I am modifying an application that make the Pc speaker have acces to the rtp stream comming from a telephone. The problem is, the rtp stream could be one of G.711U or G.711A or G.729 or G.729A depending on which codec was setup and the Speaker supports PCM_UNSIGNED. … | |
Hi, all How to make connection to database more dynamically using hibernate. Example while my application running, I want to change connection to other server and database name but structure database is still same. I using jdbc I commonly using code like this [CODE] public static void getConnection(){ try { … | |
Hi there, I seem to be having problems multiply two BigDecimal numbers without loss. Can anybody explain to me how to do this, please? | |
Hello guys. I needed some help with my calculations. I'm having a problem with having my output display the total amount. I believe the problem is coming from trying the float calculation. | |
I need to design an Ages class with fields to hold 3 ages and includes a constructor, accessor and mutator method. Also needed is a method that returns the average of the ages. I also need to write a demo class that creates an instance of Ages class. The demo … | |
Hi there, Can someone figure out why I am getting this problem, please. In my algorithm, i have this method that takes in a BigDecimal value and returns a BigDecimal value as shown below: [code] public BigDecimal sigmoidActivationFunction(BigDecimal sum) { Big_pi test2 = new Big_pi(); //sum = sum.multiply(new BigDecimal(-1.0)); BigDecimal … | |
Hello to every one.. I have another question, If i write my code, as: [CODE] line = BbmReader.getFileReader("input.txt").readLine(); StringTokenizer tokens = new StringTokenizer(line); while (tokens.hasMoreTokens()) { System.out.println(tokens.nextToken()); } [/CODE] then it shows the tokens of only first line of file. How can i make it to go to the next … | |
Dear friend it is days that i couldnt find any solution for my problem. I use: [CODE] while ((line = reader.readLine()) != null){ StringTokenizer tokens = new StringTokenizer(line," "); System.out.println(tokens.nextToken()); } [/CODE] this loop for reding all inputs of file but this loop only shows the irst token of the … | |
![]() | I've got a problem in that I have a dll I've created and most of the functions work without any problem. There is only one function that throws the exception stated in the subject, NoClassDefFound. I've checked the classpath along with all the other things I can think of, obviously. … ![]() |
please help me in finding the proble in the following code import java.awt.*; import java.awt.image.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; class button extends JButton { public button(String s) { setName(s); setVisible(true); } } class label extends JLabel { public label (String s) { setText(s); setVisible(true); } } class loginform … | |
Hello, I need some help....I have to create part of an application that uploads an MS Excel file, and stores the data into a MySQL db...and I have no clue where to start... | |
[code="Java"] public void actionPerformed (ActionEvent e) { String hostServer, fromEmail, fromTo, contentSubject, contentMsg; if (e.getSource()== btnSend) { hostServer=txtHost.getText(); fromEmail=txtFrom.getText(); fromTo=txtTo.getText(); contentSubject=txtSub.getText(); contentMsg=msgArea.getText(); // Establish a TCP connection with the mail server. Socket soc = new Socket("" + hostServer, 25); // Create a BufferedReader to read a line at a time. … | |
hi all I m new for the J2ME technology.. I m currentlu using text file to save the data needed for my application as a database.. Then accessing it to store it into Record Store.. But wwhile using the text file i need to design it in some format and … |
The End.