35,618 Topics

Member Avatar for
Member Avatar for Onlineshade

Which compiler is needed for the following code? [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import javax.mail.*; import javax.mail.internet.*; public class Main extends JApplet implements ActionListener{ JTextField firstNameArea; JTextField lastNameArea; JTextField emailField; JTextField phoneNumber; JCheckBox myselfBox; JCheckBox someoneBox; JTextArea messageArea; public void init (){ setSize (250,300); setLayout (new BorderLayout …

Member Avatar for JamesCherrill
0
191
Member Avatar for she05

Hi all, I am currently trying to pass an arraylist as a parameter for adding and deleting a student from the arraylist. Well, I have just learned about arraylist. Is it possible to pass an arraylist as parameter. Your help will be highly appreciated. Thanks. My codes below: [CODE]package student; …

Member Avatar for JamesCherrill
0
131
Member Avatar for chiiqui

[CODE]public class GAME { boolean gamestatus = true; double amounts[] = {0, 0.01, 0.5, 1, 5, 10, 11, 14, 20, 300, 600, 150, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28 }; Briefcase briefcase[] = new Briefcase[27]; public void casesSetup(){ for (int i …

Member Avatar for chiiqui
0
127
Member Avatar for chiiqui

Can this code of mine be more efficient? [CODE]import java.util.Scanner; public class Game { public static void main(String args[]){ boolean gamestatus = true; //Boolean to control the whole game double total = 0; //Temporary variable for storing the average Banker banker = new Banker(); //creation of the object banker; int …

Member Avatar for JamesCherrill
0
166
Member Avatar for Donieob

I want to produce a moving average for a time series using the JFreeChart MovingAverage.createMovingAverage method in org.jfree.data.time.MovingAverage. But my data is a countdown, i.e. the values for the time parameter are counting down. So when I apply this moving average function it produces a moving average counting up not …

0
148
Member Avatar for harinath_2007

Hi guys.. The method createScreenCapture() in Robot class made me to post this question. The method works absolutely fine and it does the functionality of capturing screen as it asked to do. Now the problem comes here when i take the snapshot of my screen while i play a game. …

Member Avatar for mKorbel
0
118
Member Avatar for lionconqueror

Hello. I am developing a class manipulater in which I add and delete some fields and methods. I have a main class which is connected to GUI. Whenever I change a class, I have to restart the GUI in order to get the changes applied. I would like to gently …

Member Avatar for lionconqueror
0
114
Member Avatar for miltondollar

import javax.swing.*; public class NestedLoop { public static void main(String args[]) { for(int x=0;x< 5;x++) { for(int y=0;y<=x;y++) { System.out.print("*"); }// end innerloop System.out.println(""); }//end outerloop System.out.println(); }//end main }//end class

Member Avatar for Rameshwar Soni
-1
104
Member Avatar for authi

Methods: public class metod { public static String computation1 { JOptionPane.showMessageDialog(null," Area of a Circle"); String n = JOptionPane.showInputDialog(null,"Enter a Number"); int num = Integer.parseInt(n); int form1 = (3.14 * (num*2)); JOptionPane.showMessageDialog(null,"… is "+form1); } public static String computation2 { JOptionPane.showMessageDialog(null,"… of a Trapezoid"); String h = JOptionPane.showInputDialog(null,"Enter Height"); int …

Member Avatar for JamesCherrill
0
4K
Member Avatar for jackiewcc

What are the suitable software methodology can be used to develop an Instant Messenger application in Java? [B]An Offline LAN-based Office Messenger[/B] I got read about the Rapid Application Development! Is it the most suitable methodology?:-/

Member Avatar for JamesCherrill
-1
129
Member Avatar for chamnab
Member Avatar for ecclesiastes3:1

good day everyone... can you give me a code for mouse listener i really appreciate it example.... the mouse is moving right or left the image will follow the mouse here's the image.......

Member Avatar for Majestics
0
72
Member Avatar for stevanity

I made this simple program for a 2 player TiCTacToe game. But It doesnt seem to be working properly. I cant understand whats going wrong here! Please help... [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MainFrame extends JFrame { JButton [][] buttons= new JButton[3][3]; JTextField statusBar; GamePanel panel; Integer …

Member Avatar for stevanity
0
110
Member Avatar for Onlineshade

How to take input in a array in Java? my code is.... [CODE] String[] array=null; Scanner sc = new Scanner(System.in); System.out.println("How many Numbers:"); String r = sc.nextLine(); Scanner sc1 = new Scanner(System.in); System.out.println("Enter Number:"); for (int m = 0; m < r.length(); m++) array=sc1.next();[/CODE] I cant do this. Please help.

Member Avatar for Ezzaral
0
114
Member Avatar for lynnb86

I have my project done in NetBeans, and it runs fine with no errors. However, when I try to compile the main class it says : C:\Users\Lynn\Documents\NetBeansProjects\EmployeeInfo\src\employeeinfo>javac Emp loyeeInfo.java EmployeeInfo.java:35: cannot find symbol symbol : class Name location: class employeeinfo.EmployeeInfo Name saveInfo; ^ EmployeeInfo.java:83: cannot find symbol symbol : class …

Member Avatar for lynnb86
0
301
Member Avatar for maxypro

Hello Everyone, I`m New to java. I need to search a jtable when i`m typing in a jtext field.As an example if i`m serchin my jtable by customer id and in j table it has customer id`s like 10021 and 10022 when i have typed"1002" the jtable should show both …

Member Avatar for Onlineshade
0
184
Member Avatar for Majestics

I am starting this thread to gather some useful information before i start my work I am working on a project which takes user information and store it in database.. Now each user has seperate department's. I simply want to attach the user information to pre-configured outlook with department email.... …

Member Avatar for Onlineshade
0
177
Member Avatar for luddite

I have a log in page for users, which if the login name is valid takes user name and puts it into a session.setAttribute(“user”, String); the user then gets redirected a userspage.jsp. At that page I can get the “user” using : <% getAttribute = (String)session.getAttribute("user"); %> the user is …

Member Avatar for luddite
0
155
Member Avatar for aldeene

why this code is not working?, error: non-static variable jTextField1 cannot be referenced from a static context [CODE]try{ Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sample", "", ""); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT name FROM testtable"); while (rs.next()){ String n = rs.getString("name"); jTextField1.setText(n); } stmt.close(); con.close(); }catch(Exception e){ [/CODE]

Member Avatar for Onlineshade
0
1K
Member Avatar for 11684

Hi, I just started programming in Java, and now i tried to compile a file with the Mac Terminal (Command-line), but it did only give me an error which i couldn't explain, because this code did work in Eclipse compiler. Here's my code: [code="java"] class HelloWorldApp { public static void …

Member Avatar for 11684
0
262
Member Avatar for Nathan_11

How can i create a program wit the following problem: Input to numbers wherein the the next number is the sum of the previous two. Example: Input: Enter first number: 1 Enter second number: 2 Output: 1 3 4 7 11 18 29 47 76 123...

Member Avatar for Onlineshade
-2
103
Member Avatar for akasekaihime

I created a regform as a program but my problem is the total units is not displayed.....how can I make it compute the total units and display it........ here is the code that I made... [CODE]import java.io.*; public class regform { public static void main(String args[])throws IOException { BufferedReader br= …

Member Avatar for NormR1
0
154
Member Avatar for sim_pack

hello, is there a way to display a pdf file within a java application? can it be displayed as one of the elements in a panel? thanks..

Member Avatar for peter_budo
0
107
Member Avatar for ogollah

Can someone please help me to find an idea how you can develop image codec which can compress the raw format images of type ppm using two programs; one for the encoder and one for the decoder. using java? <-------Please------>

Member Avatar for peter_budo
0
32
Member Avatar for chiiqui

I am working on may code and I received a null pointer error , how do I fix this? all I wanted to do was remove the selected array here's my code [CODE] import java.util.Scanner; public class Game { public static void main(String args[]){ Scanner input = new Scanner( System.in …

Member Avatar for Majestics
0
242
Member Avatar for bert2385

ive already searched the threads... Plz help :( unable to access jarfile C:\Documents and Settings\staff\My Documents\fg8clients.jar

Member Avatar for thines01
0
49
Member Avatar for jjohnson33

[code]/*jesse johnson Help.java csc 110 August 25, 2004 */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Help extends JApplet implements ActionListener { // GUI Buttons JButton ifButton , ifElseButton , switchButton , whileButton , doWhileButton , forButton, clearArea; JTextArea output; JLabel statusBar; public void init() { Container container = …

Member Avatar for JamesCherrill
0
642
Member Avatar for Bozog

Hi PLEASE HELP I have a problem with my PDFBox API. I am currently getting a PDF Document and then I want to add a string at location 0,0, when i try to save it , it is not saving the changes and it remains as it is. The Following …

Member Avatar for Bozog
0
209
Member Avatar for slasherpunk

Isn't it better to use the BufferedReader function readLine() instead of read() or read(byte[])? The reason I ask is because of potential memory wastage by the read() function. If I specify a byte array of size 10, then it will become capable of accepting ten bytes from the transmitter. However, …

Member Avatar for Rameshwar Soni
0
210
Member Avatar for Duki

Is there a way in java to do something similar to this: [code=c++] class Rectangle { public: int x; string y; private: int a; string b; }[/code] Or do you always have to specify public/private for each property?

Member Avatar for harinath_2007
0
118

The End.