31,001 Topics
| |
> I'm implementation polymorphism and have one confusing that if I use instanceof then I'm trying to perform casting which voids polymorphism so will that be any way to avoid instanceof with the code and still have the program working? Block of code where I have used instanceof starts from … | |
i want code for NotePad in java language ^_^ plz help me its Mark by 25 plzzzz | |
| I have a JLabel and a JPanel which both implements MouseClicked methods and I have added the JLabel to the JPanel but when the JLabel is clicked, the MouseClicked method of JPanel is invoked. How to fix this>?? |
Hi Im am bigginer in java and i want to know :If a,b are variables of integer type and S1,S2 are variables of Student,what does mean a=b, si=s2. Is any change in way how the value pass in these examples?? I am waiting for a response best regards Eda | |
**Hey, Hi all! I'm a bachelor student, new to Java. Following code is giving error in PrintDetails() What parameters should I define in it?? Kindly check and tag out my mistakes in the following code.. Thanks ^_**^ class student { String a;String b;char c;double d; student(String name,String rollno,char gender,double gpa) … | |
| I have this printed "ljava.lang.string;@40585b18" instead of a vlaue from the string array called answers. At the moment i am not pick really as to what is pritned out. Just get the app to display something meaningfull from the array will be a good place to start right now. The … |
provide a set of PC-based tools and utilities to organize historical performance data from an OpenVMS system. Purpose of System Synopsis To capture and maintain a history of variables directly affecting the performance of the VMS production systems. Then provide a graphic interpretation of that data to allow for trending … | |
What I'm supposed to do: Rewrite the class below, so that it throws appropriate exceptions instead of returning -1 as an error code. Write test code that attempts to withdraw and deposit invalid amounts and catches the exceptions that are thrown. Original code: class Account { private double balance; public … | |
Hi techies got a small problem a swin related one... I found a similar article here [Click Here](http://www.daniweb.com/software-development/java/threads/89427/how-to-programatically-select-a-cell-in-a-jtree) But seems no answer for that in that particular thread in this forum. Since that is a very old thread thought it would be right to put in my question as a … | |
Need help with just a couple of minor errors. for the lab I am currently doing I have 2 service/class (no clients or application classes). these are my errors Car2.java:138: error: not a statement Cars D = (Car2) car ^ Car2.java:138: error: ';' expected Cars D = (Car2) car Can … | |
The class contains: - Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height. - A string data field named color that specifies the color of a rectangle. Hypothetically, assume that all rectangles … | |
So i'm working on a java program that will eventually be used like a library on an EIS system. My next step is to work with the resource adapter, and i've never done anything like this before. I understand the architecture in this case and what the resource adapter does, … | |
In a nutshell i have a java program that takes parameters from an XML file. I made a .jar file from my java project. Within the java project i have the XML file set to a static directory, i'd like to be able to change that so the jar would … | |
Hello all, I am having problems setting up a connection with a mysql database that i'm going to need to use for one of my projects. My code to establish the connection is as follows: import java.sql.*; import java.sql.Connection; import java.sql.SQLException; import java.sql.ResultSet; import javax.sql.ConnectionEvent; import java.sql.DriverManager; public class SQL … | |
I need to make a checkers board that has to be also resizeable. At the moment I'm using JPanel and it's method paintComponent to paint the squares. But the problem is with the class test: the squares drawn have to be squares and they cant go out of proportion, so … | |
help me in this code .. it is not work .. public static void CreateFile() throws IOException { File f; f = new File("myfile.bat"); if (!f.exists()) { f.createNewFile(); System.out.println("New file \"myfile.bat\"has been created"); } } public static void getFiles(String path) { File dir = new File(path); String[] children = dir.list(); … | |
The major issue I am having right now is my client class cannot run/compile, I tried different methods to fix it from calling it from overload constructor and setScores but neither work. Scoresclient.java:16: error: cannot find symbol myScores.setScores(); ^ symbol: method setScores() location: variable myScores of type Scanner Scoresclient.java:18: error: … | |
I'm trying to create a jUnit test for my EJB's and if my app just contains a few beans everything's all good but as soon as I incorporate JPA and entity-classes my jUnit test blows up. My test fails at ejbContainer = javax.ejb.embeddable.EJBContainer.createEJBContainer(); and the stack trace says the following: … | |
I have this two classes and its giving me an error when i compile it that cannot access BaseClass. package pckage1; class BaseClass { public int x = 10; private int y = 10; protected int z = 10; int a = 10; //Implicit Default Access Modifier public int getX() … | |
So I have a programming lab that we did in class for a few months but I am having major difficulity on it. These are the directions: > Specifications for Calculate grades using loops 1. Create pseudo code for your program first, to be handed in. 2. Make the program … | |
I am trying to use JQuery Full Calendar along with Spring MVC. I have made a demo like [that][1]. Target: I need to send the UPDATED calendar's data,after I enter my events, to the controller to handle it. Issue: I've succeded to re-send the calendar I've inistialzed to the controller. … | |
I am trying to use JQuery Full Calendar along with Spring MVC. I have made a demo like [that][1]. Target: I need to send the UPDATED calendar's data,after I enter my events, to the controller to handle it. Issue: I've succeded to re-send the calendar I've inistialzed to the controller. … | |
I have a program that uses a Payroll class that uses the following arrays as fields: employeeID.- an array of seven integers to hold employee identification numbers. The array should be initialized with the following numbers: 5658845 4520125 7895122 8777541 8451277 1302850 7580489 hours.- An array of seven integers to … | |
Hi! How can I implement the folowing: ABC = BCA - true BAC = CAB - true DAB = BCA - false if (((1 == 1) && (2 == 2) && (3==3)) || ((1==2)&&(2==1)&&(3==3)) || ..... ) return true; That cannot be the fastest way, right?? And how can I … | |
package now; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class Now extends JFrame { JLabel FirstName; JTextField jtfFirstName; JLabel LastName; JTextField jtfLastName; JLabel Age; JTextField jtfAge; public Now(){ //Set FlowLayout setLayout(new FlowLayout(FlowLayout.LEFT, 10, 20)); //Add labels and text fields to the frame add (new JLabel("First Name")); add (new … | |
So I want to parse a .dae collada file which is stored xml. Now to parse the file should I use the SAX or DOM parser. THe file size of the collada file ranges from 200kb-40mb files. Is the file too large for a DOM parser? | |
the web app is a simple calculator that adds and subtracts. my problem is that the add and the subtract buttons don't work i get an error message: "An error occurred at line: 19 in the jsp file: /adder.jsp Invalid character constant" <% String name = (String) session.getAttribute("name"); if (name==null) … | |
Im making this program that reads in a java file and creates a new file with a formatted version of the file. Basically every place there is a { open braces, I want to add 4 spaces to each lines after that etc.. Here is what I have so far.. … | |
I have been messing with this for 2 days now and for some reason my image will not show up. I have tried to move the code around to varying locations just to see if I am just placing it in the wrong area but nothing seems to work. /* … | |
When i use this code from another class (I'll post the client if necessary, but in the interest of making a short post:) I get an ArrayStoreException from line 31. As I see it: the array is of runtime-type V, the item that should be added to the array should … |
The End.