35,618 Topics

Member Avatar for
Member Avatar for Gerock7

import javax.swing.JOptionPane; public class StudentReport { String name; //name of the student String schoolName; //name of the school String schoolGrade; //grade in school int numOfGrades; //number of grades or number of classes double grades; //grades received double average; //average of the grades double total=0; //initialize total String trash; //to convert …

Member Avatar for stultuske
0
276
Member Avatar for Ballistixz

hello, i am in need of some help with a bit of code i been working on. i am getting "illegal start of expression" and "reached end of file while parsing" errors and its been bugging me for awhile as i am not sure why. can anyone help me to …

Member Avatar for vergil1983
0
244
Member Avatar for Pyler

I'm implementing a generi method that's supposed to traverse a binary tree in PostOrder but when I attempt to use it, the Iterator doesn't work as It should when I attempt to use ot on a Binary Tree, can anyone spot my mistake in the code? Thanks. The method makes …

Member Avatar for iamthwee
0
218
Member Avatar for Aman_5

import javax.media.*; import java.io.*; public class MP3Player { public static void main(String[] args) throws Exception { File file = new File("xyz.mp3"); MediaLocator mrl = new MediaLocator(file.toURL()); Player player = Manager.createPlayer(mrl); player.start(); } } }`` when i execute above program, it shows error : Failed to configure: com.sun.media.PlaybackEngine@ce124a7 Bad header in …

Member Avatar for JamesCherrill
0
358
Member Avatar for romdan94

How would I write this program: Wrte a program that will read a line of text that ends witha period, which serves as a sentinal value. Display all the letters that occur in the text, one per line and in alphabetical order, along with the number of times each letter …

Member Avatar for JamesCherrill
0
276
Member Avatar for staffmbm

I'm trying to show data from mysql database in JSF, but getting error: javax.servlet.ServletException: /index.xhtml @16,70 value="#{userBean.getUserList()}": The class 'com.dev.UserBean' does not have the property 'getUserList'. javax.faces.webapp.FacesServlet.service(FacesServlet.java:325) I'm using http://www.devmanuals.com/tutorials/java/jsf/database/viewdata.html tutorial UserBean.java package com.dev; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; …

Member Avatar for stultuske
0
1K
Member Avatar for syasya

Please help me I cant answers these questions at all . Question b Suppose a class named FootballClub is to be definêd. i. Suggest THREE (3) data members for the class' ii. suggest TWO methods other than accessors and mutators for the class' iii. code the class in Java based …

Member Avatar for syasya
0
136
Member Avatar for andi-dev

public class NumFormat { public static void main (String [] args ){ int quarter = 2; int dollars = 3; double total = dollars + quarter * 0.25; final double TAX_RATE = 8.5; double tax = total * TAX_RATE ; NumberFormat formatter = NumberFormat.getNumberInstance (); formatter.setMaximumFractionDigits (2); System.out.println ("Totali:$" + …

Member Avatar for Doogledude123
0
131
Member Avatar for Halkawt.Papula
Member Avatar for asaidi

Hi i m trying to make a combobox that user can choose a value from a table this value then it is saved i have the code really i m stucked on combobox.. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; //The API for …

Member Avatar for asaidi
0
2K
Member Avatar for thomas_18

How do i get make the correctLabel to have all the text disappear so there is NO "correct" and the "buttonclicked values". I have been tryin but i can only manage to get the "correct" to dissapear the button clicked values are not removed correctLabel.setText("Correct: " ); // this sets …

Member Avatar for thomas_18
0
211
Member Avatar for duncan55

Im trying to add odd numbers recursively from n to m but its not working . im sure its in the recursive logic on how im passing the arguments or something. public static int OddSum(int low, int up,int total) { if(low==up) { return up; }else { low+=2; return total += …

Member Avatar for jwenting
0
208
Member Avatar for brittney_2

I am just learning how to call arrays through methods and I know how to do it when they are integers, however, my teacher did not go through too much on what to do with Strings. I figured they weren't much different, overall same concept, however I keep getting an …

Member Avatar for stultuske
0
12K
Member Avatar for new_2_java

Hello everyone, I am writing a Java program to reset LDAP account password. I know the password should be quoted passwrod and then encoded in UTF-16. I have a question, if someone can confirm please. I am getting encoded password as follow: String oldPassword = "Password1234"; String newPassword = "Password9999"; …

Member Avatar for new_2_java
0
1K
Member Avatar for asaidi

Hi just starting learning java jdbc .. i have this error: Type mismatch: cannot convert from int to Object **tempRow = new Object[]{rows.getInt(1), rows.getString(2), rows.getString(3), rows.getDouble(4), rows.getString(5), rows.getInt(6), rows.getDouble(7),rows.getString(8)}; **

Member Avatar for jwenting
0
273
Member Avatar for Anto_1
Member Avatar for Anto_1
0
243
Member Avatar for Reapt

So I'm teaching myself Java. I'm creating a text based game. I have an if statement that i want to check users input so its like this: if(sc.next() = "help"){ System.out.println("info"); } else if(sc.next() = "item"){ System.out.println("info"); } Etc. But it wont work. What would be the proper way to …

Member Avatar for stultuske
0
227
Member Avatar for shit3432

*Doing the PSEUDOCODE but stuck in the middle. Please help me out.* Scenario: After practicing and learning problem solving skills for an extended period of time, you have decided that life would be easier if you did not need to continue with school. Rather, you decide that winning a large …

Member Avatar for stultuske
0
210
Member Avatar for Reapt

Creating a text based game. I have a method for each of the following: Race, profession, name. So for instance: public static void main(String[] args) { // TODO code application logic here intro(); name(); System.out.println("Welcome " + name); } public static void String name(){ System.out.println("Enter Name:"); String name = sc.next(); …

Member Avatar for Reapt
0
155
Member Avatar for cvandal

Hello, I'm trying to calculate the maximum and minimum distance between 10 points. My method to calculate the maximum distance is working fine however my method to calculate the minimum is returning 0.0 and I'm not sure why. Could someone please take a look at my code and tell me …

Member Avatar for cvandal
0
212
Member Avatar for Dane2259

I'm trying to setup the programming environment for Princeton's online course at this website: http://algs4.cs.princeton.edu/code/ However, when I try and run one of the programs I get the following error: /Users/dane/algs4/algs4-2/RandomSeq.java:45: cannot find symbol symbol : variable StdRandom location: class RandomSeq double x = StdRandom.uniform(); ^ /Users/dane/algs4/algs4-2/RandomSeq.java:46: cannot find symbol …

Member Avatar for stultuske
0
288
Member Avatar for Yousif_3

Hello, I am making a small application to access WEKA code in Java for Machine Learning. In the code I should specify a data file to work on and mainly it is an Arff file. How to use a file that the user has uploaded/opened or chosen ?

0
81
Member Avatar for Tu Dinh

Hi everyone, I'm having trouble that always failed to deploy the Project: **This is Deployment Descriptor (web.xml):** <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>Eagle</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/Beans.xml</param-value> </context-param> <servlet> <servlet-name>Processor</servlet-name> <servlet-class>EITServletPackage.EITProcessorServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Processor</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <filter> <display-name>EITIssueProcessFilter</display-name> <filter-name>EITIssueProcessFilter</filter-name> …

0
296
Member Avatar for teitsu

package userinput; /** * * @author CHIEF_OGUNDE */ import javax.swing.JOptionPane; public class Main { /** * @param args the command line arguments */ private static void show(string, "Not Yet Implemented"); public static void main(String[] args) { // TODO code application logic here int ERROR_MESSAGE; String first_name; first_name = JOptionPane.showInputDialog("First Name","Enter …

Member Avatar for stultuske
0
203
Member Avatar for Reapt

Using netbeans IDE 8.0, and have JDK 1.8. Created a project and file that does this. public class Tutorial { public static void main(String[] args) { // TODO code application logic here system.out.println("Hello World!"); } } and when running i get this error... Exception in thread "main" java.lang.RuntimeException: Uncompilable source …

Member Avatar for JamesCherrill
0
364
Member Avatar for jackjuma12

Can somebody help me here plz. I have created a popup login window (resized) jsp from index page. On clicking login, the page is directed to homepage.jsp after verification using servlet. I want the subsequent pages to have the original size not the popup window size. How can I do …

0
94
Member Avatar for Raymond_3

10) A statement that creates invokes findAll() based on the argument 8 and assigns this to a new array 11) A print statement that prints out the array created in the above step. Which i did with the following bit of code in my driver ArrayMethods arrayTwo = new ArrayMethods(); …

Member Avatar for John Code
0
172
Member Avatar for parsa123

i write code with class f that have constructor : public f(int number){ this.number=number; } i want to write method that get one f then add it with f which the method was called on it public void add(f number) { //the code } what is the code????

Member Avatar for Doogledude123
0
161
Member Avatar for jalpesh_007

Dear all, I am developing SOAP web service using netbeans. As i have got preferred SOAP request and SOAP response,now i want to add security information like username and/or password in my SOAP header Request. Please tell me how can i modify or add username in my SOAP header Request …

Member Avatar for Ewald Horn
0
3K
Member Avatar for mrabrar09

here where am doing mistake and program is showing error non static method cannot be refferenced to static context

Member Avatar for mrabrar09
0
219

The End.