36,051 Topics
![]() | |
I don't know how to use Notify and wait in my program but I am required to. The point of my program is that there are two threads, one which assigns the inputted object to the numbers 1-10 and another that reads them. Could anyone help. [CODE] package vairables; public … | |
Hello guys I need some help about the Pascal's Triangle. It's not about showing an output of the triangle itself but it's a little different. The user will be asked to choose a row number in the triangle. After that, it will output the sum of all the values above … | |
[B]Problem[/B]: (The Person, Sruden, Employee, Faculty, and Staff classes) Design a class named Person and its two subclasses named Student and Employee. Make Faculty and Staff subclasses of Employee. A person has a name, address, phone number, and email address. A student has a class status (freshman, sophomore, junior, or … | |
Hi there! I'm an IT student, doing a final project of some sort for my college, a board game called "Game of the Generals" (something similar to Stratego). I've done some work in C# using Visual Studio 2005, but my experience told me C# is a rather poor language to … | |
[CODE]package demo.weatherforecast.main; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import org.xmlpull.v1.XmlSerializer; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.util.Log; import android.util.Xml; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.Toast; public class EditCity extends Activity { String xmlFilepath … | |
![]() | I've created a component (a replication of a JSpinner) with a JTextfield, and two JButtons. I've created ActionListeners on each of the JButtons to update the JTextfield. In my main program, I've create new objects based on my new component. I've added ActionListeners on my new objects.JButtons. My new ActionListeners … |
Using the code for JMS client and did the same as mentioned in the http://www.java2s.com/Code/Java/J2EE/ThisexampleisasimpleJMSclientapplication.htm and run time exception occured exception is : Exception occurred : com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [localhost:7676]. - cause: java.net.ConnectException: Connection refused: connect com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [localhost:7676]. - cause: … | |
Hi, I'd like to develop an algorithm that would only accept positive real numbers and would loop the input until the input is a real positive number. | |
hello all I create a Jpanel ,with TextField For name and password. My question is how to increase My TextField Height,is is veri short ,I need to increase to 300 % of it's now 's height I include partial code below thanks denny [ICODE] JLabel lblnama=new JLabel("NAME"); JLabel lblpassword=new JLabel("PASSWORD"); … | |
[CODE]import java.util.Scanner; class M6 //Main Method { public static void main(String args[]) //Index of Largest Number method { int a[]; int i; a= new int[10]; System.out.print("Enter any 10 numbers:"); Scanner s = new Scanner(System.in); a[0]=s.nextInt(); a[1]=s.nextInt(); a[2]=s.nextInt(); a[3]=s.nextInt(); a[4]=s.nextInt(); a[5]=s.nextInt(); a[6]=s.nextInt(); a[7]=s.nextInt(); a[8]=s.nextInt(); a[9]=s.nextInt(); System.out.println("The 10 no.'s you have entered … | |
Ok, I have no idea how to use a class I created its probably really simple but I still cant figure it out Person employee = new Employee("Tom Jones", "777 B Street", "408-888-9999", "tj@xyz.com", "Room 221", "$30450", [COLOR="Red"](2, 8, 1987)[/COLOR]); I am trying to use this with this class I … | |
Ok I am a programming student and need help with a problem, I already have most of it (so I don't need you guys to do my hw :P) but I am having problems with am, and I am not even sure if I am doing it right. [B]Problem:[/B] (The … | |
im currently programming a simple space invaders.. i have the aliens, missiles and the player.. all of them are working smoothly, but say those aliens are landed into the earth, when missiles hit the stones (for example) the stone must hava a damage. like in "GUN-BOUND" by mobius. can anyone … | |
Hello All, I'm currently having an issue trying to retrieve elements that have been saved within my arraylist. I currently have two classes, Project and Staff. In the Project class, i have declared an ArrayList of type [i]staff[/i], as seen below: [CODE]public static ArrayList<Staff> staff = new ArrayList<Staff>();[/CODE] In the … | |
i have taken two fields date of issue and date of maturity like this [CODE]try { tDateofIssue=new JFormattedTextField(new MaskFormatter("##-##-####")); tDateofIssue.setBounds(200,130,125,30); c.add(tDateofIssue); } catch (Exception ex) { ex.printStackTrace(); } try { tDateofMaturity=new JFormattedTextField(new MaskFormatter("##-##-####")); tDateofMaturity.setBounds(200,400,125,30); c.add(tDateofMaturity); tDateofMaturity.addFocusListener(this); } catch (Exception ex) { ex.printStackTrace(); }[/CODE] and taken both the field of date/time … | |
Hi everyone... I feel like this is the end of everything....I cannot do this java, I have reviewed the lecture slides again and again and I still cannot do it....Yes I know I am stupid but I really do need help.... This is my assignment, and it is simple (For … | |
Hi , I am facing a strange issue and google could not help me either here. So now, i need your advices my friends. I have a file called hello.jsp, the contents are : [B][CODE][/B]<?xml version="1.0" encoding="ISO-8859-1" ?> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 … | |
hi guy, i am trying to create a text wrapping method soemthing like this [CODE] public void textwrap( String text, int width){ } [/CODE] what i need it to do is to print the text in a column of specified width. for example a user set width to 20, what … | |
does anyone have any knowledge on serial port communication in java? can someone please direct me? | |
This is the code generating xml to feed into Javascript How to convert javascript output of the image to swf format using JAVA.. [CODE] package com.info.chart; //Contributor: i18n : Pedro Casals Fradera (2006/06/22) import java.awt.Color; import java.awt.Font; import java.awt.Paint; import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import java.text.NumberFormat; import java.text.SimpleDateFormat; import … | |
Hey, I am very new to php. I have a PHP script (modified from [url]http://woogley.net/misc/Highscore/)that[/url] I call from a my Java code to access a database in order to read/write records. The SELECT part of it was perfect. However, i can't write to the database when I try to UPDATE. … | |
import java.util.Scanner; public class fibonacci{ public static void main(String[] args){ int n=0; int fib = n+1; Scanner X=new Scanner(System.in); System.out.print("Enter # of the term: "); n = X.nextInt(); for (int i=3; i<=n; i++) { i = i-1 + i-2; } System.out.print("Term is: "+n); } } I know the algorithm is … | |
Soon I will be needing to generate reports and have a way to send emails. Is there a good approach to accomplishing this? I will have data coming from Apache Derby Database and forms. If I could get some key words etc I could start to study Possibilities. Any links … | |
Hello: TABLE NAMES : /////////////////////////////////////////: : TABLE NAMES : 10.6.2.1 - (999685): : TABLE NAMES : Apache Derby: : TABLE NAMES : Apache Derby Embedded JDBC Driver: : TABLE NAMES : 10.6.2.1 - (999685): : TABLE NAMES : /////////////////////////////////////////: : Hello I have a problem understanding why my Prepared Statement … | |
Hi all, To do OCJP certification what are the things should I learn . Pls suggest some good tutorials Thanks in advance | |
I want to connect the mysql database in netbeans IDE 7.0 but I dont know how to do this. plz plz provide me any idea about this as soon as possible. | |
i ask my teacher why java doesn't support pointers my teacher reply me that it is because pointer's are very hard to understand so java doesn't support the pointers. but i don't think that it is true. please help me by giving the right reason. | |
I am trying to deploy a simple struts application using jsp and am getting the following error when i try to deploy [ICODE] HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Exception in … | |
Hello! I am writing an application for an embedded system with GUI written in swing. I now want to incorporate animations in the GUI to enhance usability. Hypothetical example: The user sees a table with some buttons ant things around it. The user can temporarily "save" the table, which makes … | |
okay so ive finished this code but now i have to modify it so that it uses the following lines of code to make the program "easier" to understand private static void writeText(BillboardInterface billboard, int x, int y, String text) private static void writeLetter(BillboardInterface billboard, int x, int y, char … | |
i've made this little game but the image keeps on flickering. i've read about double buffering online, but i really don't know how to implement the code into my game. here's some of the source code from the constructor and paint method: [code] public Game(){ super("test"); setSize(495,429); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); try{ … | |
Okay I am working on arrays in class this week and since it is an online course I don't have anyone to turn to. YAY me! Basically this is what I have been asked to do. [I]Create a class named TVShow.java. Data Fields can include a String containing the Name … | |
Hi I have a class which I have packed as a jar file.When I run the jar on its own the application executes as expected.I have got a JFrame(Main) which has a button which when clicked, fires off the jar. But the JasperViewer doesnt launch at the end unless the … | |
Hello All, I am new to the field of security testing. Can u guide me to some startup material to get into professional ethical hacking or share ur personal tips in the former. Thanks in advance | |
i want to add isEnabled() method to JTextField, i write a code [CODE]tRate=new JTextField(); if (tRate.isEnabled()){ JOptionPane.showMessageDialog(c,"press any key to get rate"); }[/CODE] but it is giving message just after compilation of program instead when tRate is enabled | |
I am given a assignment in college to make a project in java. i want to make program in java but my teachers advice to make a system program not application program. But i don't know anything about system programming in java so please guys suggest me topics and also … | |
I'm having trouble printing out what I want. If I put my printing statements inside the Calculate method, it does print out what I expect. However, I want to do it in a separate method. Can anyone tell me what I did wrong? Also, can anyone point out to me … | |
i want to make a program that contains two main classes and they call each other. [CODE]class Main1 { public static void main(String arg[]) { for(int i=0;i<5;i++) System.out.println(i); Main2 m1=new Main2(); } } class Main2 { public static void main(String arg[]) { static int j=0; for(int i=0;i<5;i++) System.out.println(i); if(j==3) break; … | |
Hii guys.... i am a new programmer of java. i want to implement a problem using CALL BY REFERENCE as i have done in C. please help me to do this. | |
Hello guys, Im new at java. Ive been googling this for hours but don't have any luck. In HTML, there's this colspan thing wherein you merge two or more vertical cells. These cells become one. I want to know what's the syntax for that one in java. Also, I want … | |
I need to make the integer "order" save to a text file or database (All I need it to do is to count how many times you win & save it there). Every time the game starts up, I want it to read it, & every time the game is … | |
Hi I am using jasper reports to generate pdf reports from product data.I am storing the pdf file into a database column (blob) using FileInputStream.I have got a desktop application which retrieves the tables from the db.What would be the best way to retrieve and view the pdf file in … | |
can we add mouse click event on multiple controls in a single frame, if yes plzz specify the code or jst giv starting of code | |
hi guys, i want to develop the biometrics (finger print) attendance system in java. To do so what are the areas i need to learn? can u recommend me some links, ebooks, etc. on the matter of this. thanks | |
i m having trouble in constructing a edge detector by using the sobel kernels and expected results are the vertical, horizontal and gradient edge image. Sobel kernels : [-1 0 1 hx = -2 0 2 and -1 0 1] [-1 -2 -1 hy = 0 0 0 1 2 … | |
I know there are several related threads, but a lot are more advanced than what I'm trying to do. I swear, I've looked at ALL of them, on many different forums. I'm in a 2nd year Java class in college, professor is not the best...I've read the book, Googled for … | |
[CODE]import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class CheckIn{ Date today; void getArrivalDate() { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); try { System.out.print("Enter Date in dd/mm/yyyy format: "); String d = Keyboard.readString(); today = df.parse(d); df.format(today); } catch (ParseException e) { e.printStackTrace(); } } void … | |
So basically I am done with my project, I've passed to our instructor already, and I've achieved an above average grade, but one thing though I am still not satisfied, can someone check this code out for me? give me few tips? ? or tricks about this? here's my code … | |
Hi all I need to send form data to email .. Can any one share some sample code .. Thanks in advance |
The End.