32,199 Topics
| |
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 … | |
[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 = … | |
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 … | |
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 … | |
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; /** … | |
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()); } … | |
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 … | |
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. | |
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"; … | |
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 { … | |
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 = … | |
Can anyone tell me what I am doing wrong? I can't get it to calculate the charges. | |
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 … | |
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 … | |
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 … | |
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); … | |
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, … | |
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. | |
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...??? | |
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 … | |
[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 … | |
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[]) { … | |
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 … | |
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(""); … | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 |
The End.