32,204 Topics
| |
Hi guys, my lecturer has mentioned overriding the equals method before. Am I correct in saying that you override the equals method so that instead of checking if two objects have the same reference it checks their values? And therefore is it also right that there is only one code … | |
I wonder if it okay to write a big equation in System.out like this or Seperate [CODE]else if (earn>=200 && earn<=693) { System.out.println("Excess Earning" + (earn-200)); excess = (8.40+((earn-200)*.15)); System.out.println("Tax Withholding" + excess); }[/CODE] | |
I am working on some assignment. I read the book, and did exactly as it said, but it came up some weird error I don't know how to fix. Please edit my problem, so I can continue my work. Thank you. [CODE]import java.io.*; public class Assignment4 { public static void … | |
hello please help me i have a program and i want to connect to the database i don't have any idea on how to connect because im still a begginer on this..help me please how to connect to the database,hoping for your positive responds | |
Hi, Im suppose to write a Maximum consecutive sorted substring in a string. "abacdefkabfh" is acdefk. Im suppose to analyze the time omplexity of an algorithm.. I dont know where to begin | |
i want to add condition if >100 is error but when im try to add the condition the program is running but not what i want... can somebody tell me what should i do..tq import java.util.*; public class test_scores { public static void main(String args[]) { Scanner input = new … | |
Hello everyone! I'm currently making my own implementation of java.util.List, and it's going pretty well. I've just run into a minor problem. I'm currently doing the 'addAll(int index, Collection<?> c);' method. But I can't seem to figure out how to make it start at the specified index.. this is the … | |
Hi I would like to know what operator to use for a number in between my input. Is it something like this? If I input the number between 116 and 200. [CODE]else if (Earn>=116)&&(Earn <=200)[/CODE] | |
hi there i wanted to know if there is something like global or extern variables (in,c language),which i can use in every class ?! and my other question is ,if is there a complete tutorial on netbeans gui builder , because i have lots of problems about jframes. thanks a … | |
hello please help me i have picture then i want to put on my JButton but the problem is that my picture is too big its jpg file how to make this bmp file so that it fit to my Jbutton..hoping for your positive responds | |
Hi, I have a pixel array grabbed with [I]PixelGrabber[/I]. I done some computation with it and now I need make a BufferedImage from it. The problem is I can't make it very fast, just slow. I made an Image type object from it then I converted it to a BufferedImages … | |
Hi I am a novice working with Java and the eclipse IDE. What I want to read words from a text file, store it as a list converting it to some uniform case. Then I input some word/sentence from keyboard and check whether it is present in the file. Well … | |
[B]Input file[/B] --> input.txt (contains the lines below) --------------------------------------------- 1. Something something 2. Something something 3. Something something 4. Something something 5. Something something --------------------------------------------- [B]Requirement:[/B] Read the text file line by line and compare a character in the current line with all the lines below it. For example if … | |
Hi all, I have extended JButton to myButton this is my constructor [CODE]myButton(String text,char key){ this(text); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(Character.toUpperCase(key)),"Action"); this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(Character.toLowerCase(key)),"Action"); this.getActionMap().put("Action",action); this.setMnemonic((int) Character.toUpperCase(key)); }[/CODE] I m using single key shortcut for the myButton and i am using setToolTipText(String) But when i hover it shows me like this "Move Tool Unknown KeyCode: 0x0" … | |
I'm writing objects in a link list to file and when I write more thatn a certain number I get a StackOverflowError. My list has Item objects which have long part numbers, two doubles, a string, and an int. here's the code that is failing; [CODE] try { FileOutputStream fos … | |
Hi i am very new to java and have come across this problem in my code. Will someone please explain to me why i am getting a null point exception and what one is? I have tried to find out what it means but i cannot find an explanation anywhere. … | |
hi, I am trying to build a small program that can search java ‘class’ files and ‘method’s from a repository where millions of java files are stored. In addition it has an algorithm(LONGEST COMMON SUBSEQUENCE) to compare the results to find the similarity percentage and user can make precision by … | |
[B]Hi, Please could someone help with the following, I am a beginner at Java :) Thanks[/B] There is a rhyme (a bit like 'Ten Green Bottles' ) called 'Bottles of Beer' which runs thus: 4 bottles of beer on the wall, 4 bottles of beer, Take one down, pass it … | |
I'm given a project to develop program to search text files in a folder to find matches for a given text and list the containing files. I can't use Java built-in data structures. I have to use my own data structures with algorithms. I thought of building a data-structure similar … | |
Hi, I wrote a python program that counts the occurance of each alphabetic character in a string and it works fine. I tried to port it over to java but now it fails, telling me that there is no alphabetic characters at all in it. [CODE]for (int i=0;i<alphabet.length;i++) { for … | |
how to create a submenu in Swing. I am using Netbeans IDE 6.8. Please help me. thanks in advance | |
Following examples and threads of previous inquiries I find myself asking two primary things 1. Why when I place the following code - [CODE]Break;//break the string[/CODE] at the end of my while statement that reads [CODE]while(!name.toLowerCase().equals("stop")); //begin while control statement end = true; //end if condition is true, counter initiated … | |
I have a class, Cast(as in cast of a play), that implements the Collection<Actor> interface(Actor is a class representing an entity in a game) and I have the following code. [code=java] Set<Actor> toRemove = new HashSet(locations.keySet()); //method 1 toRemove.removeAll(actors); //method 2 for(Actor actor : actors){ toRemove.remove(actor); } [/code] if I … | |
I have an assignment where I am supposed to get a user input file with data in it, like below: [QUOTE]Billy Bob 98.6 98.6 98.6 100 200 300 400 500 600 700 800 900 110 220 330 440 550 660 770 880 990 111 222 333 444 555 666 777 … | |
I would like some help with this program that I wrote for my class project. I have a class Point, class Circle and a main test program. I'm having difficulty with where to put some if else statements to find the quadrant that the points x,y are located. I wrote … | |
Hi, How to edit the following xml file without losing elements. eg: [code=xml] <book id="b1"> <bookbegin id="bb1"> <para id="p1">This is<b>first</b>line</para> <para id="p2">This is<b>second</b>line</para> <para id="p3">This is<b>third</b>line</para> </bookbegin> </book>[/code] I try to edit the above xml file using dtd using jsp,servlet. but while i read the textvalue from xml, it return … | |
If in big problem, I want a to add the ResultSet of MySQL in JTable.Table should in Panel. and There should be autosizing of the result. | |
i am making a media player to play all types of media player using jmf technology. can anyone help me to figureout how jmf can play all files () | |
i want the output detect the error because the condition is -20-20, 1st key in is ok but the second time no matter what number i have key in it will accept even i key in out of condition. please help me... import java.util.Scanner; import java.text.DecimalFormat; public class CPI { … | |
hay there hope you will all be fine I an idea about the product for that i need a software but i dont know that in which software it will be made my idea about the product is that "I want to make a product in which all the information … |
The End.