35,618 Topics

Member Avatar for
Member Avatar for Prakash.G

I'm trying to connect mysql database through API, and I'm using the following coding. I could't get the proper access to the database. Do I need to create a JDBC to the database or is there any other options available? <%@page import="java.sql.DriverManager"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.Statement"%> <%@page import="java.sql.Connection"%> <% String …

Member Avatar for milil
0
223
Member Avatar for cool_zephyr

I'm packaging my java program as a jar..it includes mysql-connector.jar..it runs fine when i run it in eclipse..now i need to distriute the jar file..I packaged the jar file and when I run it through command line using java -jar myprogram.jar, it throws ClassNotFoundException: com.mysql.jdbc.Driver could anyone please tell me …

Member Avatar for cool_zephyr
0
349
Member Avatar for Violet_82

Hello, I need to build the following GUI ![b1ec49424775312369c320b6b57981d8](/attachments/large/2/b1ec49424775312369c320b6b57981d8.jpg "b1ec49424775312369c320b6b57981d8") and as usual I was hoping to have some advice before I start building it. In particular, I wonder if you guys think I should have any JPanel at all or if it is better to attach everything to the …

Member Avatar for Violet_82
0
717
Member Avatar for wallet123

Hello. I want to be able to create a listener for a cell in my JTable. Whenever write a number in a JTable (every key release) I want the value on the other column to decrease something like this: Quantity|Borrow 10 | 0 8 | 2 i use window builder …

Member Avatar for wallet123
0
911
Member Avatar for Doogledude123

So I just finished up a way to solve Standard Form Quadratic Equations, Now I want to code a way to automatically Convert a given Standard Form equation to Vertex Form, or Vertex to Standard. Is it possible due to the fact that you have to get a perfect square …

Member Avatar for Doogledude123
0
1K
Member Avatar for CoilFyzx

Hello good afternoon. I have successfully serialized data in the past, however it seems as if I don;t fully understand the process. I have a class called ProgramState which stores a variable (called lastCreated) with custom class LinesProject and an ArrayList variable(called recentProjects) of this custom class. The purpose of …

Member Avatar for CoilFyzx
0
389
Member Avatar for dlmagers

Needing some help with a small problem. I have this program that is not compiling correctly. The instructions are simple which are: The PairTest should prompt the user for the two values, create a Pair object with the values and then print the average, distance, maximum, and minimum of the …

Member Avatar for JamesCherrill
0
191
Member Avatar for ZaneDarklace

How do i post my codes on here? I did it once by accident and don't remember how i did it.

Member Avatar for ZaneDarklace
0
81
Member Avatar for renagadejesus

This is just a simple program that acts as a calculator for school age children. My professor requested that I add a declarations section. If possible could someone help me which parts of my code I need to add.

Member Avatar for JamesCherrill
0
313
Member Avatar for supra

I am a #rd yr. B.Tech student & want to do projects on C & Linux Shell Programming.It will be of great help if I can be supplied with some project titles for freshers with industry relevence. Thanking you, Supra

Member Avatar for stultuske
1
419
Member Avatar for troval

import java.util.*; public class n00883428 { public static void main(String[] args) { Scanner in = new Scanner(System.in); { int i; int j; int numPeople; int numCount; int upTo = 0; long memory; long startTime; long endTime; System.out.print("How many people are in the circle?"); numPeople = in.nextInt(); System.out.print("Enter number to count …

Member Avatar for troval
0
268
Member Avatar for CodeHaze

Hello, new to Java and I've been doing some coding for a few weeks. Right now I am stumped. I've been trying to make a program that would display how many days are in the month when the user inputs a month number, but it keeps saying that DaysInMonth.java:64: error: …

Member Avatar for cgeier
0
576
Member Avatar for murali2489

Hi Team, I have two java Files 1. Print (Package A) 2. Apple (Package B.C) (Jave file is inside C:\Z\A\B\C\ I have compiled and kept Print.class file inside C:\Z\A\B\A\ Now i have made a Jar file of Print.class named MyJar.jar and kept it in Z\A\ When i try to compile …

Member Avatar for murali2489
0
665
Member Avatar for user25

I'm not sure how to normalize the values to get the output that I want. I created a method called normalize. The values come from my txt file. The output I want is - Quizzes: 66% Labs: 88% Lab attendance: 81% Midterms: 91% import java.io.*; import java.util.*; public class FindGrade …

Member Avatar for stultuske
0
2K
Member Avatar for murali2489

Hi Team, I am almost going to finish learning core Java and my employers said openings are available for Hibernate/Spring/Struts. I am just wondering whether can i directly start studying one of these frameworks after Core Java. Some people said these Frameworks contains JSP,servlets and important J2EE concepts so that …

Member Avatar for rubberman
0
265
Member Avatar for pekemp23

I am trying to finsih this coding and something is missing and teacher has asked me to init the doubles. I am struggling with the finishing touches of this program. import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * The MenuWindow class demonstrates a menu system. */ public class CellPhonePackage extends …

Member Avatar for stultuske
0
251
Member Avatar for preyas.hanche

I want to make a program to accept strings and make a pyramid of strings, but I cant make the right loop, I have the logic: But this seems to make only half- pyramid, can somebody help me with the right loop import java.util.Scanner; public class Stairs { public void …

Member Avatar for stultuske
0
133
Member Avatar for praveenadevar

Hi , i have done a project in servlet , i didn't get any error in the coding and console page . My problem is that datas are not added to the database. Below are my files. What i'm doing wrong ? StudentRegistration.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" …

Member Avatar for wallet123
0
330
Member Avatar for bigredaltoid

Hi all - I am writing a program that uses two classes: One class is the InfixtoPostfix, which is actually the class that changes expressions from infix to postfix. (Example: ( A + B ) * ( C - D ) to A B + C D -*. The second …

Member Avatar for iamthwee
0
931
Member Avatar for murali2489

Hi Team, Im preparing for OCJP and in one of the sample question is below Three version of MyClass.class exist on a file system 1. /foo/bar/ 2. /foo/bar/baz 3. /foo/bar/baz/bing And the system class path includes /foo/bar/baz And this is the command invoked from /foo java -classpath /foo/bar/baz/bing:/foo/bar MyClass Which …

Member Avatar for murali2489
0
298
Member Avatar for zack123

I have a studied java and self taught on netbeans. i would like to use open source APIs and packages for writing heuristics and machine learning programs but dont know where to start. How to learn to use a new API ? Like genetic algorithm package or metaheuristic package? I …

Member Avatar for milil
0
200
Member Avatar for narlapavan

my code: class A{ Vector<String> s = new Vector<String>(); } public class Vec { /** * @param args the command line arguments */ public static void main(String[] args) { A a = new A(); a.s.add("String1"); a.s.add("String2"); a.s.add("String3"); a.s.add("String4"); a.s.add("String5"); Vector<A> vecA = new Vector<A>(); vecA.add(a); System.out.println("Size of vector is "+vecA.size()); …

Member Avatar for milil
0
216
Member Avatar for stresstedout

I am trying to get 20 images displayed on a jframe in jlabels using a gridlayout. I have added a while loop but still i am only am to see 1 image, please can you help me to display more than image in jlabels on a jframe? setSize(600, 600); setDefaultCloseOperation(HIDE_ON_CLOSE); …

Member Avatar for JamesCherrill
0
215
Member Avatar for mundrusuresh

hai to all iam decided to develop student information report so i decided to the gathering results from site and those converted to either .pdf or .xls file so i requested to code for to obtain the student reults from the any website thanking you sir

Member Avatar for Builder_1
0
99
Member Avatar for islam-morad

Im using hibernate and i tried to do the following session.get(Company.class, 1); After i executed the statement above i got this strange select statement generated by hibernate Hibernate: select company0_.Company_ID as Company1_31_4_, company0_.version as version2_31_4_, company0_.Address_ID as Address5_31_4_, company0_.Company_Code as Company3_31_4_, company0_.Company_Name as Company4_31_4_, company0_.Phone_ID as Phone6_31_4_, address1_.Address_ID as Address1_0_0_, …

Member Avatar for milil
0
190
Member Avatar for pavi.mythri.1

Hi, could some one help me in resolving this issue. Below is the code in which i am trying to call open Calais API to extract the keywords from the content by using the lisence key. package com.clearforest; import java.rmi.RemoteException; import javax.activation.DataHandler; import javax.mail.internet.MimeMultipart; import javax.xml.rpc.ServiceException; public class CalaisDemo { …

Member Avatar for cgeier
0
344
Member Avatar for 2384443

Hey Guys, could you tell me the different ways to write throw method (Exception Handling) in a program.. I mean like we can write BufferedReader in many ways (2 ways so far i've studied).. eg; 1. BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); 2. BufferedReader br; { br = new BufferedReader(new InputStreamReader(System.in)); }

Member Avatar for milil
0
245
Member Avatar for Royal_1

Assignment 1: Bank Account Class You are hired by a Canadian bank in order to develop a java application for processing withdraw and deposit transactions. The application enables staff of the bank to create new bank accounts, to process account transactions and to display the balance of a particular account. …

Member Avatar for Slavi
0
741
Member Avatar for narlapavan

class A{ Vector<String> s = new Vector<String>(); } public class Vec { public static void main(String[] args) { A a = new A(); a.s.add("String1"); a.s.add("String2"); a.s.add("String3"); a.s.add("String4"); a.s.add("String5"); Vector<A> vecA = new Vector<A>(); vecA.add(a); System.out.println("Size of vector is "+vecA.size()); // here i am getting size one a.s.clear(); a.s.add("String6"); a.s.add("String7"); a.s.add("String8"); …

Member Avatar for scudzilla
0
283
Member Avatar for mai.labarejos

Should have the Menu: [1] Empty WaterGlass [2] Add Water [3] Remove Water [4] Display WaterGlass [5] Exit ** Note: The program will only end if the Exit Menu is chosen. java program Sample WaterGlass: Current Level: 10 *** --- --- --- --- --- --- --- --- --- --- *** …

Member Avatar for Doogledude123
-1
136

The End.