No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
45 Posted Topics
What is wrong with my code? I'm trying to add a list of paths to a DefaultMutableTreeNode... I'm not getting the result I expect...can anyone help why?... [CODE] public static void main(String [] args){ List lst = new ArrayList<String>(); lst.add("a/b"); lst.add("a/b/c/d"); lst.add("a/b/c"); DefaultMutableTreeNode node = new DefaultMutableTreeNode(""); DefaultMutableTreeNode traverser = … | |
Re: The reason why it never runs true is because you have if(words[i] == searchData) instead of if(words[i].equals(searchData)) :) | |
Hi everyone, I'm trying to write this code. Whenever a user types a letter that matches what is already displayed, it should clean up the list box..the problem here is it is not detecting the keyDown event. What is wrong? Thanks for the help. [CODE]namespace TypingGame { public partial class … | |
Re: You are initializing unDoc in case 1 of switch #1. If the case 1 is true then, case 2 will be skipped. The same if the block inside case 2 is being implemented then case 1 must have been skipped. I see that is probably the problem because switch statements … | |
People, this is all my code is. I am trying to change an Integer Object to a primitive int, to use them in the getValue and Compute(Integer i) methods . Compiler Says NO.. I have tried both the solutions below ... and got the following errors i.intValue(); // no method … | |
Hi , I'm not sure if this question fits in this section. But this is as closely related as I can think of it...I hope you can help me.. In what kind of applications do we use LINQ in nHibernate? What are the advantages? I was trying to google, but … | |
AudioTrack sound = audio.createAudioTrack("ringout.wav", false); is giving me the output "WARNING: Unable to locate: ringout.wav" The sound file is in the same project folder that i am using..Anyone knows what i might be doing wrong in here? Thanks a lot. | |
Why is this code not working???? [CODE] <c:if test ="${sessionScope.qCounter == 0}"> <!-- {((Quiz1) (sessionScope.quizVal)).correctAnswer(sessionScope.boxval)) == 'true'}">!--> <br><font size='3' color = 'red'>Your last answer was not correct! Please try again!!</font><br> </c:if>[/CODE] qCounter and quizVal are a session scope attributes I declared like . [CODE] HttpSession s = request.getSession(); s.setAttribute("quiz", new … | |
I am instantiating an object of one class with aanother class.. here is how the line is.. Class1.method1(); where method1 goes something like this .. method1(){ Class2 c = new Class2(); } After creating the c object of Class2, is there anyways i can know which class instatiated it(Can i … | |
Is it a good programming practice to pass List as a parameter in a Constructor? Just learning.... Thank you .. | |
Following me everywhere? why do I get those exceptions very much??? why are they raised?? My classes are always in the same package as the class they accesses them.. I know they are there. Why doesn't the compiler find them???? thanks for your help ppl...please help :@ | |
[CODE] public class TryCatchTest { public static void MyNumber(String x) throws TryCatchException1{ try{ String y = x.substring(0,200); }catch(TryCatchException1 e){ System.out.println("BBBBB"); System.out.println(e.getMessage()); // e.printStackTrace(); }catch(java.lang.StringIndexOutOfBoundsException e){ System.out.println("AAAAAAA"); e.printStackTrace(); e.getMessage(); } } } class TryCatchException1 extends java.lang.StringIndexOutOfBoundsException{ TryCatchException1(){ super(); } TryCatchException1(String msg){ super(msg); } }[/CODE] why is my exception not caught on … | |
[CODE]public class Employee { private String name; private String SSN; private Employee e = new Employee("ME","MYSSN"); Driver x = new Driver(32); public Employee(){ } public Employee(Employee e){ this(e.name,e.SSN); } public Employee(String name, String SSN){ this.name = name; this.SSN = SSN; } public static void main(String [] args){ Employee e = … | |
About a week ago, i doenloaded the free Microsoft Security Essentials as a protection for my computer. I had a Norton Antivirus before that, and it used to find 20-30 threats per day...Since I installed this new antivirus from the microsoft website, its been a week and no threats detected … | |
Re: hi, i could not test your program because it did not compile..but i think your problem could be in compairing objects rather than their values. if ( Created == false && Accname.equalsIgnoreCase(name) && Regkey.equalsIgnoreCase(key) ) i think your problem could be in this line..here you are comparing if the two … | |
Re: import java.applet.*; import java.awt.*; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; public class testingdemo extends Applet { private final int RECT_OP = 1; public int opStatus = 5; private int mousex = 0; private int mousey = 0; public boolean dragging = false; … | |
I have two classes in here..One extends from a Jpanel , it is where I do all the paints and staffs on my screen. The other one is just a class. But in that class I want to define a draw function..say public void draw(Graphics g){ g.drawImage(image,100,100,30,30,?????); } Now, I … | |
Re: JFrame y = new JFrame("myframe"); y.setBounds(300,400,300,300); You could try this , the first two variables being for the X and Y position where the frame is put and the next two for the widtha nd heigth..Does this solve your problem?? | |
Re: can u compile your code.it has some errors like temp +7 and staff..not statements; .it will be much easier to see the problem if u do that first. | |
I have many projects in a software. Although some files and classes are shared within these projects, there are classes used by most of these projects. How do i creat classes that can be shaed among different projects . Is there anything in java that can function the same as … | |
How do I creat one in JAVA? Is there a tool I can use in netbeans? thanks a lot.. | |
Re: It compiles pretty well here, u should check if there is anything wrong with the rest of your code! | |
Re: hi, i'm not sure what u want yor program to do. But in these lines where you used 2 for loops , the internal loop is doing really nothing, just assiging the maximum value to x [index]..... hope this will be of some help for(index=0;index < x.length;index++) { for(int i=Min;i<=Max;i++) … | |
I got a BSc. in computer science over two years ago.. now i'm thinking of getting some more education on mostly programming and staffs. What does the MSc in computer science cover. Anything diffferent from what is mostly covered in the BSc programm??? I'm jsut confused if it would be … | |
I want to put the buttons on my screen wherever i want, i'm not using design view. Is there any layout method or any other method i can use to reposition my buttons.PLEASE HELP! | |
Does any one know in which method the cursor in the dnd class is set, while dragging an object!! thanks lotts | |
I'm a nubbie network administrator in my office, a couple of guys installed a mysql server, deployed a database(along with it) and also an application program that accesses data from the mysql server. I can ,using sqlog, log using a specific username, pwd, port number, servername(here i use localhost) . … | |
I have these java packages, There are different games in java with menus, buttons and everything. Now i want my software to be jsut like the other softwares which one can install and use. My problem is I don't know how to create a set up file in java. I … | |
I can connect to a computer using remote logging, i specifically use the IP adress of the computer to avoid any confusion. The problem is writing the ping command from the same computer i remotely logged from does not work.. what am i doing wrong, i'm sure i'm using the … | |
hey, I'm having a problem in getting this programm right.. this is what it does...in every 1000ms it paint an image.. I'm using a new thread to paint the image....the thread taking care of the paining then creats a new thread to play the sound..But what i want is to … | |
I'm using the java DnD class...I found this programm as an example that could help me understand it better..While dragging the image...the cursor changes its shape..but what i want is the image being dragged instead of te cursor...that is i want to replace the cursor with the image while i'm … | |
I'm trying to programm a game where the user can drag and drop images... I have some programms that do this by calling the repaint function for every mouse motion...I have also come across programms that use the java.awt.dnd class..I'm confused here..I don't know what will be the best...how does … | |
i restarted my computer and got the messege 'ntldr missing press ctl +alt+del' to restart I inserted the Windows XP pack 1 CD , and booted from the CD and in tried to repair the missing files by running this two lines from the command line C:\WINDOWS> copy e:\ ntldr … | |
everytime i scan this flash there is this virus Trojan horse..and i see that a bunch of folders that i did not creat see to be created...even after deleting the virus these folders keep coming back..what do i get rid of them for GOOD!! please help | |
I paint a lot of images on my screen before the JFrame is displayed...It takes along time..what can i do to make the image load faster.. | |
I have a code that play's an animation on a JFrame.. On top of that, I have added a Jpanel with few buttons. my problem is, mybuttons are not visible on the animation screen until i hover a mouse on them?? what am i doing wrong.. | |
I have a server that runs Windows server 2003..the problem is in the password field it does not type '@' or whenever i press the @ key it does the same thing as the tab key...goes into to the textbox, please help, how do i write @..Is there anything i … | |
I have a programm that runs an applet. It loads a series of images and paints them. The problem is the programm seems to not to paint the images in the same order..or rather it skips some of the images....what can i do? I tried using the udate(screen) function but … | |
this is a code that i found fromsome website I replaced line 18 by this line below, and put theimage ho.gif in the project folder. Sth is wrong..image is not displayed on the screen? what is the problem?? I jsut wanted to try it using one image only............that's why i … | |
Hey everyone, i'm working on this code...i'm trying to put some images ---animations--on to my jpanel..the problem is everytime i try that, it gets repainted with initial screen setup I have...how do i solve this..here is the code.. import com.sun.org.apache.bcel.internal.classfile.JavaClass; import java.awt.event.*; import java.awt.image.ImageObserver; import java.text.AttributedCharacterIterator; import javax.swing.*; import java.awt.*; … | |
I don't wan't my buttons to reacts to hover events or any other events... and i dont want to disable them.............................how do i do that without disabling them ? | |
i wanted an image background on a Jpanel, so I got a programm that overrides the paint function. Now i have a code that draws the image as a background and also enabled me to have some buttons on it...now i want to add more images (or animations) on my … | |
Hello, i'm using a Jpanel, I am using an image as background . On top of that i want to put buttons on it. The problem is I cannot repostion the buttons? can anyone help me here!!?? | |
Hi, I want to make the background of the JFRAME and image??? but everytime the background image paints over the buttons???? please help! |
The End.