32,199 Topics

Member Avatar for
Member Avatar for john249D

I need to write an inheritance hierarchy for classes quadrilateral, trapezoid, parallelogram, rectangle and square. Quadrilateral bieng the superclass of the heirarchy. Make the hierarchy as deep as possible. Specify the instance variables and methods for each class. The private instance variable of Quadrilateral should be the x-y coordinate pairs …

Member Avatar for jwenting
-1
139
Member Avatar for KSUliz

[code=java] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; import java.text.DecimalFormat; public class Grades extends JFrame { //construct components JLabel title = new JLabel("Grades"); JTextPane textPane = new JTextPane(); int numberOfGrades = 0; double total = 0; DecimalFormat twoDigits = new DecimalFormat ("##0.00"); //initialize data in arrays int[] grades = …

Member Avatar for moutanna
0
170
Member Avatar for lumbeelock

Can someone please HELP??? [CODE] public class Person { private String name; private String address; private String phoneNumber; private String email; public Person(){ } public Person(String name, String address, String phoneNumber,String email) { this.name =name; this.address=address; this.phoneNumber=phoneNumber; this.email=email; } public String toString() { return "Person "+ this.getName(); } public String …

Member Avatar for moutanna
0
278
Member Avatar for why1991

For my program I am working with simple graphics and need to display a straight row of squares from left to right decreasing in size. I also have to program this recursively so that it makes the squares following the first one by itself. My problem right now is that …

Member Avatar for darkagn
0
116
Member Avatar for ceyesuma

hello. I believe my InputStream is is null. Is there a way to get it to work? [code]InputStream is=pr.getClass().getResourceAsStream(path);[/code] [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package schoolAppView.utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** …

Member Avatar for BestJewSinceJC
0
170
Member Avatar for ceyesuma

hello. Could someone tell me what I need to change to get the initial contcext for my JDesktopApp? [code] public JDBCSchoolofdbDAO() { try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup( ModelUtils.getResource("JavaCompEnv")); dataSource = (DataSource) envCtx.lookup( ModelUtils.getResource("DataSource")); } catch (NamingException x) { ModelUtils.log(x); throw new InternalError(x.getMessage()); } …

Member Avatar for ceyesuma
0
199
Member Avatar for jnthn205

Can someone tell me how to print out each array and its value? we are given a random array of 1000 doubles. If a value in the array is above or below 90% the average, we are to print the "flagged" values. So far, I just have it printing one …

Member Avatar for jnthn205
0
208
Member Avatar for crackers8838

Hi, I was wondering is anyone could tell me how or give me pointers on how to convert the base of a number to another base. For example 2010 base 3 to base 4. I am stumped and I would appreciate any help I could get.

Member Avatar for javabru
0
89
Member Avatar for ardn0001

Hi, Im new in this forums looking for an answer for my problem, I find a similar post here so I decided to suscribe here because this website look very professional. I had the following code: [CODE=java]public class Gen { public static void main(String[] args){ args = new String[6]; args[0]="0101"; …

Member Avatar for ardn0001
0
186
Member Avatar for gajen007

I have confused to use Java Native Interface with dll file (by c++).. To get the squired value of a number which will be given by user... this is my class file...which also should be converted as header file for c++ file (dll file preparing...) import java.io.IOException; class First { …

Member Avatar for Freaky_Chris
0
147
Member Avatar for samrin

here is my code but i need to get output if my Sample input: 3 Sample output * *** ***** *** * will must look like this! now can anyone please help me with this .. [code=java]public class p2.java{ public static void main (String args[]){ int x; SimpleInput sInp = …

Member Avatar for javaAddict
0
168
Member Avatar for snowball14

Can anyone tell me what I am doing wrong? I can't get it to calculate the charges.

Member Avatar for stultuske
0
108
Member Avatar for java=hard

I have been scrounging about, trying to get to compile this properly, but I get a stupid error message at the end. I also do not know how to implement an accumulator into the methods, could someone at least teach me how to implement one? Into Main, or just a …

Member Avatar for stultuske
0
157
Member Avatar for knowledgelover

Hello there, we have a web application that must read a card which is plugged to the client, the reading of the card is done via a specific library, which is as a jar file, as have googled that situation , concluded that to achieve that we need to use …

0
71
Member Avatar for Virux

Alright, been trying for at least an hour. I want to be able to add functions to a JPanel Example, JPanel a = new JPanel(); a.setTransparency(color, strength); or something like that. a.myFunction(parameters) Is this even possible? I am getting sick of overiding the paint method for every panel I create …

Member Avatar for Virux
0
90
Member Avatar for chern4ever

need help, this is my code! [CODE]import javax.swing.JOptionPane; public class Lab2_1 { public static void main(String[] args) { int value1=0 ,value2=0 ,operator=0; String temp4="1"; while(temp4 != "0" ){ String temp1 = JOptionPane.showInputDialog(null,"Please enter first value."); value1=Integer.parseInt(temp1); String temp2 = JOptionPane.showInputDialog(null,"Please enter operator.(+,-,*,/)"); String temp3 = JOptionPane.showInputDialog(null,"Please enter second value."); value2=Integer.parseInt(temp3); …

Member Avatar for javaAddict
0
107
Member Avatar for sawant_nitesh

content eg. 1. java.lang.String, 2. java.util.HashMap<Integer, Integer>, 3. java.util.ArrayList<Integer>, 4. java.util.HashMap<Integer, ArrayList<String>>, 5. java.util.HashMap<Integer, ArrayList<ArrayList<String>>>, I need a regex for matching method parameters in Java. I have tried with this one.. ([a-zA-Z\. ]+,)|([a-zA-Z\. ]+<[a-zA-Z\., ]+(<[a-zA-Z\., ]+>)*>[ ]*,) It is matching first 4 strings. But it is not matching 5th one, …

Member Avatar for Freaky_Chris
0
86
Member Avatar for morisboy

Hi, Is it possible to create a jar file (mobile app) from JSP files? I mean instead of using some toolkit to compile the java files and create the jar file, can I do the same using JSP files? Thanks.

Member Avatar for peter_budo
0
118
Member Avatar for jasrose

hi... Iam doin a research project in cluster based bit vector algorithm... i.e. a combination of clustering and bit vector concepts... will you help me to start the implementation...???

0
27
Member Avatar for musikluver4

I just wanna be able to input 10 integer numbers, display the numbers, then be able to modify a specific number I have already entered, then display the new updated numbers again. [code] //Date: 4/6/2010 import java.io.*; public class EnterNumbers { public static void main(String[] args) throws IOException { BufferedReader …

Member Avatar for musikluver4
0
215
Member Avatar for bravo659

[quote] I am working on a homework asisgnment from school and need some help. I am stuck on coding to set a private field to my Box class with three constructors.. It's kind of confusing when dealing with more than one constructor. The following is the code for the box …

Member Avatar for vchandra
0
173
Member Avatar for why1991

I am trying to make a row of decreasing squares with a recursive method, but none of the squares comes up besides the first one. Any ideas where my code is going wrong? [CODE] import java.awt.*; import java.awt.event.*; import java.util.Random; public class Lab19ast { public static void main(String args[]) { …

0
82
Member Avatar for johndoe444

What is the meaning of compiling a regular expression? Not only in java but also in other languages like python has compiled representation of a regular expression. Actually it always bothers me what happens when a regular expression is compiled? All I know is it makes further matching of patterns …

Member Avatar for BestJewSinceJC
0
81
Member Avatar for bigbags911

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TicTacToeV1 implements ActionListener { /*Instance Variables*/ private JFrame window = new JFrame("Tic-Tac-Toe"); private JButton button1 = new JButton(""); private JButton button2 = new JButton(""); private JButton button3 = new JButton(""); private JButton button4 = new JButton(""); private JButton button5 = new JButton(""); …

Member Avatar for BestJewSinceJC
0
130
Member Avatar for idlackage

Dumb question, but I've searched everywhere and found nothing specific: is it possible for HSB values to translate directly into a colour (eg. a hue of zero equals red) instead of passing them through an RBG conversion? Also, dumber: I'm not understanding the arrrays people are using, for example [URL="http://www.squarebox.co.uk/users/rolf/download/ColourWheel/ColourWheelApplet.java"]here[/URL] …

Member Avatar for idlackage
0
91
Member Avatar for isuruj

I tried to execute following target. [code=xml]<target name="A"> <svn> <checkout url="${svn_url}" destPath="ab"/> </svn> </target>[/code] and I got the error "failed to create task or type svn Cause: The name is undefined." I have TortoiseSVN, ant home is ok, got the antsvn lib and put them into ant_home\lib So I don't …

Member Avatar for jonataschagas
0
51
Member Avatar for falsedimitrii

I want to enable/disable a table cell based on the contents of another cell. e.g. if the reference cell value is "true", then enable the cell, otherwise disable the cell. I have set up isCellEditable() to do this and it works if the reference cell already has a value when …

Member Avatar for falsedimitrii
0
2K
Member Avatar for triplea_2005

Write a Java Class file for the class Account that represents a bank account. Usually, a bank account has a unique account number that is used to identify it. Your class should generate the account number automatically whenever a new account is created. The class should also store the account …

Member Avatar for triplea_2005
0
200
Member Avatar for artanbori

Hi struggling with java - we have a class Structures and Algorithims in which we are supposed to pick up java in 5 weeks Have been pouring over material and searching sites but trouble is when I start to write ends up nothing seems to work unless we copy and …

Member Avatar for artanbori
0
254
Member Avatar for shantuli

hi, can anyone help me to solve the following java problem write a java program for holding a stack of up to 10 characters. pls help me. thanks you shantuli

Member Avatar for usurph
0
99

The End.