32,199 Topics
| |
hey everyone, i have few text files that contain some data. what i need is to be able to display those file names in JTextArea and if the number of text files increase/decrease i would want the file names automatically change in the JTextField(after next compilation). i would be very … | |
I am writing a program that is supposed to count the number of vowels in an inputted (by the user) body of text. [CODE] import java.util.*; public class Vowels{ public static void main(String[] args){ Scanner console = new Scanner(System.in); int counter= 0; System.out.println("\nInput a sequence of characters"); String text = … | |
I could not get this past my editor, and am not bright enough to understand why. My TA and I do not share a common language fluency and I do not understand remotely what he is saying. Can anyone tell me why this doesn't run? [CODE]import java.util.Scanner; public class sumMatrix1 … | |
Hi, I need a little help, i found out to repeat an action/animation automatically I need to use a timer but im having troubles implementing it into my script. This is the last few part of the action... public void slowMoveVertical () { sun.slowMoveVertical(-100); } Now I what I want … | |
I have to write a code that displays a 4 x 4 grid of faces. I am stuck and this is wat i have so far: [code] import java.awt.Graphics; import java.util.Scanner; import javax.swing.JApplet; public class Program7 extends JApplet { public void init() { setSize(2000, 2000); } /** * Draw one … | |
Hopefully this is my LAST QUESTION!! D:< Anyway, I saw a code on lloydgoodall.com for an LWJGL FPCamera. It had SEVERAL errors, but I finally got to the (hopefully) last error. "Keyboard must be created before you can query key state" My code: [code] import org.lwjgl.Sys; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; … | |
[code] import java.util.*; package everything_is_an_object; class MyClass { int i; char c; } public class Main { public static void main(String[] args) { MyClass x = new MyClass(); System.out.println(x.i); System.out.println(x.c); } } [/code] My error is on the second line,that was generated by my IDE,with the package. What si the … | |
I have to create a class called Polynomials and other called PolynomialTerm. The latter one to copy, add and multiply PolynomialTerm (exponents, coefficients). I also have to do the same for the Polynomial(which is an arrayList of PolynomialTerms). I am having problems adding the two polynomials.I need to do this … | |
Hello, I have a project in BlueJ, called Game. Inside this project, I have the following files: File_A - A JApplet file which creates instances of Class_A and Class_B and calls their respective member functions. File_B - Implements Class_A (a JPanel) File_C - Implements Class_B( a JPanel) In order to … | |
Hi , i have created web application in that i want to get the facebook user profile like image, name , education etc. can any one plz suggest which API i need for that or what are the steps i have to take for to fetch profile in JAVA. | |
Hello All, I am having some troubles with my code, which is: [code] import java.net.*; import java.io.*; class TestInet { public static void main(String args[]) { try{ InetAddress inet = InetAddress.getByName("72.14.203.106"); InetAddress inet1 = InetAddress.getLocalHost(); InetAddress inet2[] = InetAddress.getAllByName("www.google.com"); //InetAddress inet3 = InetAddress.getHostName(); System.out.println ("Host of IP is[inet.getByName]: " + … | |
Here is my code. [CODE]import javax.swing.table.*; import javax.swing.*; import java.util.*; import java.awt.*; import java.awt.event.*; import java.awt.print.*; import java.awt.geom.*; import java.util.Calendar; public class Salary_report extends JFrame implements ActionListener { Vector data; JTable table; JLabel banner; ImageIcon images; Container c; Employee_report f1; JButton print; String s,days,basic,pf,hra,esi,bonus,advance,allowance,loan,incentive,dother,da,eother,gross,ded,net,leave; double ge,td,np,l,l1; public Salary_report(Employee_report f1) { … | |
Hey guys! I'm trying to make this flowchart but I not quite sure how to do it. I'm supposed to make a flowchart that will ask the user a specific month and year, and the output would be how many days that that inputted month and year has. Kinda confused … | |
I want to create a new thread in a program that i'm working on but i cant get my new threads to start does anyone have some code that would allow me to create and start new threads | |
Hello World! Im doing a simple program that runs a JFrame and has some JButtons etc etc but id like to put a simple sound to one of my buttons, when i quit the program i want it to play a simple melody how can i put it in this … | |
Hi, I'd like to implement the following but I have no idea where to start: I have a JTable with 1 column containing Date. Now i'd like the cells in this column to be editable. I have a datepicker that i'd like to pop up when this cell is clicked … | |
I've toyed around a great deal trying to get my calculations correct in this countdown program, but I keep getting the same result. Basically, I'm creating a program that will countdown from a users inputted number. At each second it will display whatever amount of seconds remaining. My problem is … | |
Is it possible to add two separate arrays into one hash set? | |
Hi, I'm writing code for a graphical map of a shopping center. Whilst writing the code I realised it would be simpler to be able to draw objects using "names" instead of values. E.g. g.drawRect(Asda); instead of g.drawRect(100,100,40,40);. Is this possible? I have tried writing various classes but I can't … | |
Hi, I need to store data entered into my java application such as the persons name, address, ph number, date etc to be saved in an xml file. I also need to retrieve it so it can be displayed. If you can point me in the right direction that would … | |
Hey, I have tried everything that does not work to change the color of the text on a JButton I have in a JPanel. Does anyone know how to do this. I need the actual text on the button to be a different color than black..This is an application so … | |
hi All, my issue i have a clob data type in hibernate mapping , and i have one textarea from where the data will come , that will be big data , that is actually the data for webpage , now if i want to know how to get that … | |
Hello =) I have some problem to set font and color in my program.can you take a look for the moment please?Here is my simple program: [code] import java.awt.event.*; import javax.swing.*; public class showYourLove extends JFrame //inherits from JFrame class { private JPanel panel; //to references a panel private JLabel … | |
Hi, I am developing a web-based application with Google Web Toolkit. In addition to the web-based application, I also have a desktop Java application to monitor data on the local machine. However, I want to use GWT RPC to make procedure call to the remote server, but I have tried … | |
Hey guys I found the following code snippet below... I want to know how to compile this... I am a c++ programmer and something is wrong with my mouse/audio so I thought this may programmatically solve it but I have no clue about anything java and in c++ there is … | |
Hi, need help as to what is the code doing, if possible each statement if anyone knows: When it is run, when dd/mm/yyyy format is enter, it will give 20 Dec 2010 is a Monday Why is the monthIndices and division done for ? [CODE] public static String dayOfWeek(int dd, … | |
Dear all , I have the following UML Diagram and below the associated Code. Can you please help me complete the code? Thanks in advance I have written my UML diagram as follows. -x : double -y : double +MyPoint() +MyPoint(x:double,y:double) +get X() :double +getY() : double +distance: (MyPoint1:MyPoint2):double +distance(p1:MyPoint:p2:MyPoint):double … | |
I keep on messing up the math calculations :@. [U]Error[/U] The output was shown as this" [ICODE] BMR: 40.35 pounds BMI: -83.60 inches TDEE: -114.95 years Your BMI classifies you as Obese [/ICODE] But it should be this way: [ICODE] BMR is 2308.15 BMI is 40.35 TDEE is 3173.71 Your … | |
I'm new to Java and just need a little help....The program is supposed to have the user enter in a series of numbers then displays the largest and the smallest....they have to enter -99 to end. My problem is the smallest number is always -99. What do i have wrong? … | |
ok guys so i have problem here is the goal of this program:Write a Java program that reads in this file and produces a visual representation of the seat assignments, with a passenger's name and his/her seat assignment in each seat slot here is the data in [URL="http://www.cs.oswego.edu/~odendahl/coursework/csc212/201009/assignments/03/seats.txt"]this[/URL] text file: … |
The End.