32,204 Topics
| |
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 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 … | |
1st class public class Student { private String name; private double id, examMark, courseMark, totalMark,grade; Student(String name,double id,double examMark,double courseMark){ this.name=name; this.id=id; this.examMark=examMark; this.courseMark=courseMark; this.totalMark=getMark(getExammark(),getCoursemark()); this.grade=grade; } public String getName()// to return name of student { return name; } public double getID()//to return id of the student { return id; … | |
Hi gentles! jest i am creating one stand aloe application by using JDK-1.6 Netbeans.7 Mysql i can run in net beans well and the database also working well with this, if i "clean and build" the project as jar file it working well in it's specific location (eg:D:\Raj\Gui\WorkersData\dist) But! if … | |
| Is there any free CRC Cards generator? I found just for UML but nothing on CRC Cards? Thanks |
Hi My reqvirements are as below Input is the address of a folder containing images Output should be a jframe displying first image in a folder when i scroll mouse or press right arrow key then next image should be displayed Similary when i scroll back or press left key … | |
Any About this error run: Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: stockinventoryforecast/productEntries, method: <init> signature: (Ljava/sql/Connection;)V) Constructor must call super() or this() at stockinventoryforecast.mainPage.actionPerformed(mainPage.java:226) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289) at java.awt.Component.processMouseEvent(Component.java:6504) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6269) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4860) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4686) … | |
Hi My reqvirements are as below Input is the address of a folder containing images Output should be a jframe displying first image in a folder when i scroll mouse or press right arrow key then next image should be displayed Similary when i scroll back or press left key … | |
Hello, I am rather new to this so bare with me! I am currenlty creating a BlackJack game in Java and attempting to use the MVC design when creating it. I have so far created the following classes: - Card: To hold create a card - Deck: To create a … | |
package edu.edusys.demo.jdbc.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import edu.edusys.demo.jdbc.bean.Customer; public class CustomerDAO { private Connection connection; public CustomerDAO(Connection connection) { super(); this.connection = connection; } public boolean addCustomer(Customer customer) throws Exception { String sql = "INSERT INTO Customer" + "(name,address,phone)" + "VALUES (?,?,?)"; PreparedStatement ps … | |
Hi all, I have given a assignment to implement patterm matching algorithms and to do a experimental analysis on number of comparisons, real time taken and CPU time taken for each algorithm. I have done all except CPU time calculation. Plz can anyone guide me how to do this... | |
I'm working on a program that demonstrates polymorphism. It asks the user to create an elementary, high school, or college student. Once a student is created, it is stored in an array list. When prompted, the program is suppose to print out each of the student's information. How do I … | |
Hi! I have several 55 x 55 px png-pictures, which need to be rotated by 0, 90, 180 or 270°. I tried the following but in that cases the pictures were not on their correct positions anymore. Thanks. // Import the basic graphics classes. import java.awt.*; import javax.swing.*; /** * … | |
This basic client server program compiles fine in eclipse IDE but I keep getting a zero back from server!!! I'm new to all this client server stuff by the way. package echo3; import java.io.*; import java.net.*; class Client { public static void main(String argv[]) throws Exception { int outgoingdata = … | |
have various classes representing various types of program-genres (comedy, drama etc). I have a text file filled with '-' seperated values that get read by a class called Processing and puts them into a LinkedList. I have another class GUI_g that creates the GUI. It has 3 JTables. One for … | |
Hey Guys, I am working on a gui and I've got a two part question. I've got a jlist and a couple of buttons to add and remove components from the list. I've got everything working except for the keyListener. When the cursor is on the jList (hasFocus I assume?) … | |
Hi folks.. I'm in search of desktop nofication api's apart from the basic(default) one that java already provides. Can anyone direct me to some good links . Its better if it is free of cost. I found [this](http://blog.swingfx.ch/twinkle-100) nice one but its not free. | |
| I have this block of code below which is to control questions which are to be displayed from the array. I am having problem with the the 3rd line of code, an i am not entirely sure what the problem is. rnd1, rnd2 are both double. Eclipse is telling me … |
The End.