32,199 Topics
| |
Hello. I am trying to input the name of a class that I have imported already, and can instantiate regularly, such as 'myClass inst = new myClass('foo');' and create a new instance-object of that class. The code below illustrates my question more specifically: [CODE] import java.lang.reflect.*; import java.io.*; public class … | |
I posted this out here yesterday and received several great responses using an ArrayList. During a code review it was suggested that a use a List<Sting> for the reusultset. Any Ideas would be welcomed. Thank you for all of your responses yesterday... [code] public List<String> getAnswers() throws DAOException, SQLException{ //This … | |
I want to make a program that find the alphabets present in the string using java language. e-g i hava a string " Hello World " It display me that charactes present in it are H e l 0 w r d It count a character only once. | |
i've created a database project in java in which a jtable is used to display the contents of the database.......i've also created an option for insertion of values through a textfield by button actionperformed into the database ......and now when i inserts a particular values through the textfield and when … | |
Hi, I am stuck with few problems related to JSP - Java applet file write and database connectivity issues. 1) Calling the applet class from JSP works in the web browser. But the file write code written in applet does not work when called from JSP ( It works if … | |
I want to update 0X0 when I press of the "AC Milan" to be "1X0" and the last scorer also to be updated with the winner; Also, how to fix the alligenment to the center >>! [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TestSwingListeners1 { public static void main(String[] … | |
I have connected java with oracle and providing the facility of accessing data on the lan... I have also open a port, but still my java app over lan start very slowly after that it speed up, but at startup its very slow Y? Thank you for any suggestion | |
Hello there, I'm busy working on a project using GWT and Sencha GXT libraries. I have come to this stage that I now have to populate a tree with data received from an XML file... I have no idea how to do this, I've gone through the javaDocs but it … | |
Hy again , I have another problem now , I have an application with a jTabel , you can double click a cell and you can change the value that is inside it , after you changed the value inside the cell and hit enter the value i enterd remains … | |
Hi everyone. I am trying to make a batting average calculator, but i am pretty new to java. I want to make it look like this: [url]http://www.kll.org/batting-average.htm[/url] All i have right now is JOptionPanes, and it works, but it doesnt look very nice. So i know i need to put … | |
I am new to Java and could use some help. Trying to write something using scanner or a JoptionPane to convert inputs from Gregorian to Julian. Then use interface to convert it the other way. How do I start and what do I do? | |
I believe this is similar to the dining philosophers problem but a little different and somewhat easier. [url]http://en.wikipedia.org/wiki/Dining_philosophers_problem[/url] Basically I have a barrier class and a waitingThread class. I need to create 4 threads. Each thread is meeting at a place to "eat". But none can begin "eating" until the … | |
I developed a method to query a database and return the specific values that I'm looking for except that the value being returned is the last value. In my while loop I can do a system.out.println(answers)and I can see all of the values, my return answers only returns the last … | |
i am new to java i hava saw error that illegal start of error in this program [CODE]public class double { public static void main(String[] args ) { double d=1232.44; System.out.println("the double value is :"+d); }}[/CODE] please help me | |
how to set the selected item in combo box as displayed in java. please help me | |
Java - How to use system clipboard to copy and paste objects(JLabel or JButton) in a JFrame | |
Hello everyone, I have a question regarding a Japplet that I am creating for a theatre. The program is supposed to take a yes or no response from the user, take which section the user will be sitting in, ask how many tickets they would like to purchase, and then … | |
I have a loop which shows an input dialog, process it and shows the name and picture of the student using setText and setIcon. After, I want to have at least 1-2secs of delay/pause so the user can have a look on it [B]before it loops back[/B] to show the … | |
Write a java program to read a number up to 15 digits long or a date (dd/mm/yyyy). The program should distinguish numbers from input date, and prints them in alphabetic spelling form. Example: for input 234334564456455 the output should be : 234,334,564,456,455 is two hundred thirty four trillions and three … | |
Hi..I am a newbie in JavaScript.I have two forms (in two different webpages) all with radio buttons. A user cannot select more than one option from each form. My plan is to pass the user input from both the forms to a perl script which would then query a MySQL … | |
i am new to javascript and jquery. i want a code that can load images from file, then display them one by one repetitively and randomly and possibly a text alongside each signifying something-what you call flash animation | |
I'm having problems with my code regarding the value of the string I get with the JTextfield.getText() method my code goes this way: [CODE](keypressedevent evt){ int id=evt.getId(); char c = evt.getKeyChar; String s = JTextField.getText()+c; System.out.print(s); } [/CODE] if the textfield contains for example: apple and you type s, it … | |
Hy , i read all the other posts about this error but didn`t helped me , tried google but notheing. I have the following method : [CODE] private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { // TODO add your handling code here: DefaultTableModel model = (DefaultTableModel)jTable2.getModel(); int nrrows = jTable2.getSelectedRowCount(); int[] rows = … | |
WHY WHEN I EXECUTE THE BELOW CODE I GETS AN EXCEPTION [B]java.sql.SQLException: No ResultSet was produced[/B].........BUT EVEN THOUGH INSERTION OPERATION WORKS FINE........CAN ANYONE TELL ME WHY THIS EXCEPTION COMES [CODE=java] Connection co; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); co = DriverManager.getConnection("jdbc:odbc:hh"); Statement st1; ResultSet result; st1 = co.createStatement(); result=st1.executeQuery("select count(*) from rooms"); result.next(); … | |
Hello, I'm trying to write a simple program to finde words betwen statments like <int></int>. I converted String stream to a charArray, to get indexes of chars in the string. [CODE] public void foo(){ bucket=str.toCharArray(); System.out.println(str.substring(548,563)); System.out.println(str.substring(644,656)); System.out.println(str.substring(844,857)); System.out.println(str.substring(942,954)); System.out.println(str.length()); for(int i=0;i<str.length();i++){ if(bucket[i+0]==':' && bucket[i+1]=='i' && bucket[i+2]=='n' && bucket[i+3]=='t' && … | |
So I have recently been learning java and everywhere I go I hear that java is a slow language compared to C or c++. I know that when it came out in the 90's that it was a lot slower, but I was wondering how much slower is it today. … | |
I am writing a prg which take a value from user and check weather its present in table or not.... [code] table.getValueAt(i,j).toString().toLowerCase() == searchfield.getText().toLowerCase(); [/code] Well if yes then make that cell red... What to write to make cell red? | |
I am trying to do several things. 1. Intialize - engage a user in a series of questions to assign values to the class variables, no args, no return value, called from constructor. 2. Display - displays all the class values, each in an sentence, no args, no return value. … | |
I am using JBoss as my app server. My application using almost 100 jars (libraraies).So How can I specify class path for all the libraries jar's because its not possible to define individually in JBoss_CLASSPATH .Can I define xml for the classpath but I don't know how JBoss detect or … | |
hello, I have this question to ask from you... when passing a object to a method is it pass by reference or pass by value ? I'm talking about calling another class's method... |
The End.