35,619 Topics
![]() | |
Hi all, I have a web app and in the web.xml file there is a filter which is applied to all the jsp files. However I need to change the particular filter so that it is not applied to 1 jsp file. I tried searching in regular patterns if there … | |
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 am trying to make ajax call to a jsp and setting up a few variables using(retrieved from the session) # delimiter using out.println and then use this variable in the response object of onSuccess call back function. and then i have to remove that from the session. But if … | |
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. | |
I running my little blog on Tomcat 6 server. My hosting company allows me to set up multiple sub domains. I was trying to do for last few hours, but no luck. Having started with [code=xml] <Engine name="Catalina" defaultHost="mydomain.co.uk"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <Host name="mydomain.co.uk" appBase="/home/user/public_html" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Alias>www.mydomain.co.uk</Alias> … | |
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 … | |
I am mostly following this page: [url]http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html[/url] I used this command to create the keystore keytool -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat6/keystore and answered the prompts Then i edited my server.xml file and uncommented/edited this line [code] <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="/etc/tomcat6/keystore" keystorePass="tomcat" /> … | |
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 … | |
I just cannot figure out what is wrong, so tried. Can someone please help me so I can finish this today or tomorrow please. [code] //adds all 10 panels together this.add(mainpanel); //set see the frame setVisible(true); } JOptionPane.showMessageDialog(null,"Oringinal Balance = $" + recieveAmount + "\nPayment#" + x + "\nMonthly Payment$" … | |
I am having trouble adding the ability to order an integer array in both ascending and descending order. I have implemented the functions myself and am having trouble figuring out how to order them in reverse order. I am passing in a boolean variable to test which direction the array … | |
Hi i have been trying to get a GUI in BlueJ working properly but i hav come across a prolem, i hav 2 buttons which i want to use but when i click them the actionListener wont run my methods. In the action preformed bit i tried to make it … | |
My main.java [CODE] public static void main(String[] args) { // TODO code application logic here Rational x = new Rational (); x.num = 2.0; x.den = 3.0; System.out.println (x); Rational.negate (x); Rational y = new Rational (1.0, 3.0); System.out.println (Rational.invert (y)); } [/CODE] My rational.java [CODE] package rational; public class … | |
[code=java] import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; import java.util.*; public class Transfer extends JFrame implements ActionListener { //Declare output stream DataOutputStream output; //Construct a panel for the fields and buttons JPanel fieldPanel = new JPanel(); JPanel buttonPanel = new JPanel(); //Construct labels and text boxes JLabel … | |
In here: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html#general[/url] It says: The default content pane is a simple intermediate container that inherits from JComponent, and that uses a BorderLayout as its layout manager. In here: [url]http://java.sun.com/docs/books/tutorial/uiswing/components/jcomponent.html[/url] It says: The JComponent class extends the Container class, which itself extends Component. This is contradictory, isn't it? Also what … | |
hello to everybody I have a linked list that contains objects each object contains two String field I want to know how to check if the object that i want insert is already exists in the linked list thank you | |
Can somebody help me in reading text from a file without using Java Class Library??? | |
I'm having trouble writing code to save binary trees that are created by my program. I'm trying to save the tree to a file by trying to use preOrder traversal and writing the data that way. But so far nothing gets written to the text file. I'm supposed to write … | |
im trying to take an inputed file and use a linked list to read it and display the most frequently used word. Anybody know how to do it? [CODE] import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.*; public class mostFrequentWord { LinkedList<Word> list = new LinkedList<Word>(); public void Read() throws … | |
I'm trying to wrap the following so it shows up easily on the prompt screen. How can I wrap it up? [CODE] System.out.println("Anwser the following trivia questions with a true/false input. Since I am" "a horrible programmer, you will have to enter 1 for True and 2 for False. If … | |
Hey guys! I have a program I am writing that I have gotten stuck on. It compiles fine but when I run it I get several error messages. Illegal format Conversion Exception is one of the error messages. I am stuck and I don't see where the error is. Any … | |
Hello people, Im getting an "Exception occured ---java.lang.NullPointerException" error when i try running the code below: [code=Java]public void Register(String Username, String Password, String Surname, String Firstname, String Email, String Phone) { String a = Username; String b = Password; String c = Surname; String d = Firstname; String k = … | |
From the java generics tutorial: "[CODE]List<String>[] lsa = new List<String>[10]; // not really allowed String s = lsa[1].get(0); // run-time error - ClassCastException[/CODE] If arrays of parameterized type were allowed, the example above would compile without any unchecked warnings, and yet fail at run-time." I have problem understanding why would … | |
On line no no of stars 1 1 2 3 3 5 4 3 5 1 * *** ***** *** * | |
Can Java read it's own source code? Possibly by using reflection.. or something. I would like to dynamically display the code to each method inside of my interface. Any idea how that could be acheived? Thank you. |
The End.