32,204 Topics
| |
Hello, apon summing the rows of a two-dimensional array how can you put the results into a new 2D array so that the results can be sorted from largest to smallest or vice versa? we started with a 7 column 8 row array and now want a two column 8 … | |
I had done a program with JFrame a year ago and I am trying to convert it to with JApplet so I can put it on the web. So far so good and I am able to see the applet and seems every functions are still working... there is one … | |
I am having problems setting up drop down menue for a application I am trying to do for a class. Can someone please give me some pointers. Here is the class assignment. Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage … | |
Hi I'm new to java and working on a program where I want to show the number of rentals for one person in one box and the total rentals in another box. I am having trouble storing the variable or it is not recognizing that I want to keep adding … | |
I am having error in the following code. What should I do to fix it? Also, how should I call it in main method to test the code? please HELP :( [CODE] package sortingelements; public class Main { public static void main(String[] args) { } public int indexOfMaxInRange (int[] myArray, … | |
Hopefully this is fairly basic. I've never used enumerated types in Java. I'm sort of trying to take my C concept of them and make it work in Java. Basically use them as constant integer values. That might be putting the square C block into the round Java hole. I'm … | |
I seem to have hit a wall with implementing my own version of merge sort. I can sort the list fine in ascending order, but once I try to reverse the ordering (passing in a boolean), I get an ArrayIndexOutOfBounds error. I'm guessing that what I'm experiencing is some sort … | |
I posted this on Oracle Forums to the sound of crickets chirping. This question entails more Oracle specific tasks then java but since my code is in java, here goes" Hello, I have a java package where I am attempting to implement a database Change notification registration and listener. I … | |
| public class Welcome extends JFrame { private Toolkit toolkit; private static String passy = "123456"; public Welcome() { setSize(300,550); setTitle("Welcome"); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel panel = new JPanel(); getContentPane().add(panel); panel.setLayout(null); JLabel label = new JLabel("Enter Password"); JPasswordField password = new JPasswordField(6); password.setEchoChar('*'); password.addActionListener(new AL()); label.setBounds(0,0,300,25); password.setBounds(100,0,200,25); JButton b1 = new JButton("1"); b1.setBounds(0,100,100,100); … |
Hey guys, I'm stuck at a problem. Check out the code: [CODE]import java.util.*; class testAll { public static void main(String[] args) { Scanner input = new Scanner(System.in); ArrayList pointsArray = new ArrayList(); ArrayList linesArray = new ArrayList(); System.out.println("Enter amount of sides: "); int sides = input.nextInt(); if (sides <= 2 … | |
On line no 1 there are 1 star On line no 2 there are 3 stars On line no 3 there are 5 stars On line no 4 there are 3 stars On line no 4 there are 3 stars On line no 5 there are 1 stars * *** … | |
[CODE]private void eaddbtnActionPerformed(java.awt.event.ActionEvent evt) { if(eaddbtn.getText().equals("Add")){ eaddbtn.setText("Save"); eupbtn.setVisible(false); // edeletebtn.setVisible(false); ecanbtn.setText("Cancel"); } else{ Enrollment e = new Enrollment(eid_txt.getText(),ecode_txt.getText(),egrade_txt.getText() , emarks_txt.getText() ); // ERROR APPEARS IN HERE e.SaveEnrollment(); } } [/CODE] i want to add int value to mysql database...how can i do that? how to convert int value to string … | |
I need to write a program that displays 50 priome numbers . I need to use a stack to store prime numbers.This is what I hava so far I need some help Please. My while loop is weird | |
Okay I have managed to finish everything. However, my output for average minutes and average hours is wrong for some reason. I have looked over my code multiple times and I cannot figure out what the problem is. I would appreciate any help. Here is my code. Can you tell … | |
I have a public class change which holds the private static int [B]commonresource[/B] and the methods : public synchronized void [B]increment[/B](int inc) public synchronized void [B]decrement[/B](int inc) to handle the variable commonresource I have a main class which starts 2 new threads "nikos" , "fosses" with a constructor that takes … | |
hi guys , i am trying to use flex in java , can any boday help me guiding it . and how to send data safely to server | |
I am having problem with the following code `public void grow(int size)`, can't seem to get it working import ou.*; import java.util.*; /** * Class DiscoLight * This class uses the Circle class, and the Shapes window * to simulate a disco light, that grows and shrinks and * changes … | |
my previous button does go to the previous file: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; public class StudentAddress extends JPanel { private JButton submit, clear, next, display, previous; private JLabel first, last, street, town,state, zip; private JTextField fName, lName, hStreet,hTown,hState, hZip; private int studentCount=0, displayCount=0, i; //studentCount … | |
I have a 2D image of a map. What I want to do is 1) Paint this image in a 3D Canvas. And then rotate it with the help of mouse 2) Secondly do some path planning, i.e If I select 2-3 points in space on top of that map … | |
Hello everyone I'm currently following a course "Game Development" where we learn everything from design to 3d drawing to programming. The language we use is C++, however I'd like to learn Java as well and have there for decided to create a large project (together with a number of other … | |
Hey guys, how would I happen to utilize a System.out.printf statement to make three columns with the three headings. | |
hello all friends i need your help in java.library.path setting.i use a TPM/j API to develop an application using Trusted Platform Module (TPM) specification and to use TPM/j API i need to set java.library.path and load TBSProxy.dll. I try to set java.library.path using DOS and it not works. C:\Users\lfgs\tpm\tpmj>java -Djava.library.path=C:\Users\lfgs\tpm\tpmj\lib\ … | |
Hi, I am trying to learn creating my exceptions in java. My classes are : [CODE] public class Test { public static void main(String args[]) { Test et = new Test(); int x1=5; int x2=0; try { et.printResults(x1, x2); } catch (DivideByZeroException dbz) { System.out.println(dbz.toString()); dbz.printStackTrace(); } finally { System.out.println("The … | |
Hi. I need to create a bean class from list of properties in property file. So that if i need more fields in bean i don't need to go and change code. Instead just add a property in file and at runtime, a field with given name be added to … | |
i need to find all the files in the directory and sub directory that have a text file..within this text file there is a string called average with some value.. the code below works fine for a single directory...but i need to find the same text files in the sub … | |
hi forum, i am using an arraylist for storing a list of objects.i dont want the objects in the list to be ordered but the list should be duplicate free.how can i achieve this.plz help quickly.provide source code if possible.thanks in advance. | |
so i need some help, have random int that decide which values in my Boolean array are true. All th [CODE] System.out.println ("pick a number 1-9"); int guess; for ( int i = 0; i < 9; ++i ){ guess = console.nextInt(); if (x[i] = true) { System.out.println("CORRECT!!"); }else if … | |
Hi I would really appreciate if someone could tell me what I am doing wrong. I think I have a major error but I can't seem to find out where it is =( My assignment is due tomorrow so if anyone would be up right now and could tell me … | |
Dear fellow programmers, I had tried and successfuly created JVM and used JNI from C++ executable. But when I change my C++ executable into a shared library (.so, in UNIX) like this [CODE] extern "C" int callFromFakeSID(char* name) { JNIEnv *env; JavaVM * jvm; env = UART_Display_Java::create_vm(&jvm); if (env == … | |
Hi all, Im using hibernate in netbeans to map to a mysql database, but am having problems.... when I open a session: [CODE]Session session = SessionFactoryUtil.getInstance().openSession(); session.beginTransaction();[/CODE] it prints out this in the console:... [COLOR="Red"]12/04/2010 9:50:26 AM org.hibernate.cfg.annotations.Version <clinit> INFO: Hibernate Annotations 3.3.1.GA 12/04/2010 9:50:26 AM org.hibernate.cfg.Environment <clinit> INFO: Hibernate … |
The End.