32,199 Topics
| |
import java.lang.reflect.*; import java.awt.*; import java.lang.*; class SampleField { public static void getField(Class c) { //Class c= Class.forName(s); Field f[]=c.getFields(); for(int i=0;i<f.length;i++) { System.out.println(" "); Class type=f[i].getType(); System.out.print(type.getName()); System.out.print(""+f[i].getName()); } } public static void main(String... s1) { try{ Class c= Class.forName(s1[0]); getField(c); }catch(Exception e){System.out.println(e);} } } I have written the … | |
[COLOR="red"]when i tried to register the remote object with rmi registry i got following[/COLOR]: J:\prgs\my>start rmiregistry J:\prgs\my>java -classpath .. my.Register java.rmi.ServerException: RemoteException occurred in server thread; nested exce ption is: java.rmi.UnmarshalException: error unmarshalling arguments; nested excep tion is: java.lang.ClassNotFoundException: my.MyServer_Stub ---------------------------------------------------------------------------------- [COLOR="red"]here is the code of Register.java[/COLOR] [CODE]package my; import … | |
[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public abstract class login extends JFrame implements ActionListener { public static void main(String[] args) { JTextField firstField = new JTextField(10); JPasswordField middleField = new JPasswordField(10); JButton b1=new JButton("ok"); JLabel firstLabel = new JLabel("username", JLabel.RIGHT); firstLabel.setDisplayedMnemonic('F'); firstLabel.setLabelFor(firstField); JLabel middleLabel = new JLabel("password", JLabel.RIGHT); … | |
hey, i have been working on my final year project, the program is finished and now i have do the testing. i have finished black box testing but i have no clue how to do white box testing. i have looked around the web but there is only definition of … | |
What is the difference between an abstract class and an interface?give me an example? | |
Is there a way to create a program to rewrite a query in an optimal form. If so, how? I already connected MYSQL to Java. I just need ideas on how to implement it. Thanks. Rewrite: SELECT EMPOYEE.EMPNO, POSITION FROM EMPLOYEE E, JOBHISTORY J WHERE E.EMPNO = J.EMPNO AND STARTDATE … | |
I found a link to javadoc for JXSE 2.7 from [url]http://jxse.kenai.com/Tutorials/Tutorials.html[/url] which provides a link to javadoc on kenai.com but either the link is broken or the java doc is moved elsewhere. If anyone know working link to JXSE 2.6 or 2.7 please let me. Thanks | |
NOTHING HAPPENS AFTER EXECUTING THIS CODE, BUT IT COMPILES AND RUNS SUCCESSFULLY [code]import java.io.IOException; public class Runx { public static void main(String args[]) { try { String x="cmd /c dir"; Process p=Runtime.getRuntime().exec(x); } catch(IOException e) { e.printStackTrace(); } } }[/code] Please help....................... | |
Hey; I'm trying to do a hang man game in Java. I newly learned some stuff about programming some GUI using Swing and AWT, but I'm not still clear with it. The problem is that all the drawing is done by a single function paintComponent() from the JPanel that I … | |
steps 1.I create a java project. 2.in the same java project i ll create a main class(say sample). 3.i ll call a function(say sample_function()) inside main class. question is: where should i implement the function(sample_function()) i.e should i have to create a new class in the same project or i … | |
Seem tangle myself up with coding here and couldn't solve much of problem after many long try. I need your fresh set of eyes. Below is my errors. Thanx /* *Description: Writing own method, Switch Selection Control, String,Accumulating, *Counting method, array base on last reviews from previous labs. *prepare a … | |
Hey I have a question about running an application that uses a .jar file. If I have a file outside called Tester.java that uses a jar file, let's call it myJar.jar, and let's say the classes are packaged as myPackage.myClasses. I imported all the classes I needed using [code] import … | |
After following above program i still have tons of error on my list what step i could have missed... I really need to get it to work before i could start on my project... [url]http://integratingstuff.com/2010/10/18/writing-code-that-captures-videos-on-android/[/url] | |
Sorry if this is posted in the wrong section. But I came across this question on a test: Which of the following will evaluate to true only if boolean expressions A, B, and C are all false? (a) !A && !(B && !C) (b) !A || !B || !C (c) … | |
Hi my problem is that i'm making a mobile app and i need to seperate the following string: ChrisHunter21 into: Chris Hunter 21 What is the easiest way to do this in J2ME ? i had a look at the Ostermiller one but didnt understand it. Thanks Chris | |
I've tried many time to solve this problem...but still not successful, I'm newbie..so anyone of guys can help me check this problem... [LIST] [*]Button "Back" is big as frame [*]Seems no TextField for NoOfTicket [/LIST] [CODE]import javax.swing.*; import java.awt.*; //import java.awt.event.*; public class ticketReservation extends JFrame { private JLabel jlbWelcome, … | |
Hello, i have a class "Die" and a class "PairOfDice" pair of dice extends die. i need to instance variables of type die in pairofdice constructor... i think. here are constructors for die and pairofdie.. we learned all of this earlier this semester but apparently i didn't learn it well … | |
| Edit: Never mind I figured it out. I used Math.pow(base, exponent) to figure it out I'm creating a calculator and I can figure out how to the power of two doubles. This is what I have: [CODE] public Power(Double base, Double exponent) { result = base ^ exponent; //result is … |
I know this is a very common program that has been discussed, and I have searched through all the previous posts about it but still having problems. It's a program for an airline seating reservation. Consists of 12 seats total, 1-4 is First Class, and 5-12 is Economy. I have … | |
My assignment: develop a limited application to track the statistics of sports players. For each player, track first and last name, points scored, assists made, and penalty rate. Design and implement an object capable of recording this info. Implement this object as Player. Must allow user to enter new player … | |
i have an error of line 40 illegal start of expression and line 73 class interface,or enum expected. im making a 10 random numbers display them determine the largest and the smallest number of 10 random numbers thanks.. [CODE]import java.util.Random; /** Generate random integers in a certain range. */ public … | |
I have to create a Pizza GUI that shows pizza size choices and topping choices for pepperoni and mushrooms and then calculate the total. I'm having trouble constructing the GUI. Down in the createCenterPanel method Eclipse is tell me that radioButtonPanel, checkBoxPanel, and pricePanel cannot be resolved to a type. … | |
[B][COLOR="Red"]final[/COLOR][/B] members are used to specify that it can not be [I]revalued[/I] or [I]overriden[/I]. :icon_lol: [U]Explain [B]logically,[/B] [I]why[/I][/U] a [B][COLOR="Green"]static[/COLOR][/B] method can not [B][I]override[/I][/B] comparing it with an [I]instance method[/I]. May a [B][COLOR="Green"]static[/COLOR][/B] variable be [B][I]revalued[/I][/B]? :icon_exclaim: If, [B][COLOR="Green"]static[/COLOR][/B] also serves the same purpose at this point as [B][COLOR="Red"]final[/COLOR][/B], then … | |
Hi , I have a problem. I am inserting 5 rows into a table. Before inserting i disabled the auto commit(conn.setAutoCommit(false)). And after i have not at all commited the transaction. And i used rollback for every exception in catch block. But, The transactions are saving up to the exception. … | |
Hello, I'm currently looking for a book the covers "how to develop a game". I have basic knowledge of Java. I know: arrays,classes,GUI,basic animation with Timer class,basic graphic. I want to move on and start learning threads, collitions, keyboards and mouselistener and all other game related topic... I was wondering … | |
Hello I have Java application that runs under unix and has console for user imput. I would like to perform something like this - If I enter "edit config" I would like to vi pop up with config file loaded (with java still running in background" and after user is … | |
code above would print first month correct. but from the second month days or not in order.[code]import java.io.*; public class calendertest { public static void main(String[] args) { int months=12; int days=0; int i=0; for(months=1;months<=12;months++) { System.out.println("----------------------"); if(months%2==1) { for(days=0;days<=31;days++) { if (days%7==1) System.out.println("sunday-"+days); else if(days%7==2) System.out.println("monday-"+days); else if(days%7==3) System.out.println("tuesday-"+days); … | |
I would like to know how i can replace an outputline with a write to a log file? Ive tried searching but no luck. | |
Hai, Am using client server applcation, server is in remote machine, while retreving data from client to server , it takes time, for this i want to show the progressbar in between retrieveing time, how can i do this. please help me for this problem. | |
In my program to implement huffman algorithm.I have created the huffman codes and stored the ascii values and corresponding codes in a map.While creating the encoded file I followed this approach:I firstly converted the ascii codes in to their corresponding integer values and wrote them in a file.Now ,while decoding … |
The End.