No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
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:
I don't know what is wrong with my code here, the if conditions there never run true.[CODE] String words [] = new String[10];{ //Store the word string words[1] = "apple"; words[2] = "ice cream";} String searchData = ""; JTextField mySearchArea = new JTextField(7); public void init() { setLayout(new FlowLayout(FlowLayout.RIGHT,10,10); add(mySearchArea); … |
|
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:
I have a hyerarchy of aggregation with data from a txt file. I'll try to draw it here [B]Documento[/B] has arraylist of [U]Pagina[/U] [INDENT][B]Pagina [/B]has arraylist of [U]Parrafo[/U][/INDENT] [INDENT][INDENT][B]Parrafo [/B]has arraylist of [U]Frase[/U][/INDENT][/INDENT] [INDENT][INDENT][INDENT][B]Frase [/B]has arraylist of [U]Palabra[/U][/INDENT][/INDENT][/INDENT] [INDENT][INDENT][INDENT][INDENT][B]Palabra [/B]has arraylist of [U]basicElemento[/U][/INDENT][/INDENT][/INDENT][/INDENT] To construct [U]Documento[/U], I only have to … |
|
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 … |
|
Re:
hey there. I have been struggling with separating classes in java and figuring out what methods go in what classes. when i build my apps in one file, i do them right, but when i try to separate classes, i mess up. like for example: I have these two classes: … |
|
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:
Hello, I've made registering system to my little test program, It works well until you try to create two accounts with same name, It shouldn't allow it but it still does it. I have tried to solve this problem all day now by trying diffrent methods but sadly nothing helped. … |
|
Re:
hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the following code. in the following code i am using [b]SelectionArea[/b] class which extends a canvas on which … |
|
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:
HI , Is it possible to get the window size in Java ,if so cld any 1 guide me....and also i need to fix the windows in a particular position ..how cld i do ds in Java. |
|
Re:
[code] import java.util.Scanner; public class encryption { public static void main (string[] args) { int temp, first,second, third, fourth,encryped; int a = first,b = second,c = third, d = fourth; int a = c,c = a; int b = d,d = b; System.out.println("After swapping a = " + a + … |
|
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:
Hi, just doing a uni assignment and have completed a majority of it, just asking if someone could please proofread and help me out with the last line as i can't get it to compile. heres my instructions: All objects that float through space are instances of the SpaceObject class … |
|
Re:
hi am new to java and have a problem in displaying the x and y points on the graph to solve this ax3+bx2=x+d=0 here is the code import java.awt.*; import javax.swing.*; import java.awt.event.*; /** * PROGRAM: Cubic * DESCRIPTION: This program solves the cubic Equation for a given range of … |
|
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 … |