32,204 Topics

Member Avatar for
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
165
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
147
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
115
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
113
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
103
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
128
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
71
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
109
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
293
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
182
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
175
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
261
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
102
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
153
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
105
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
31
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
240
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
48
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
639
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
208
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
202
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
114
Member Avatar for Bobonoinc

I am new to Java and as an exercise I am trying to develop the following: 2 JPanels on a JFrame where 1 of the JPanels can be used for drawing. I started from an example from Daniweb from 2010 but can't seem to get a graphic context because the …

Member Avatar for Bobonoinc
0
1K
Member Avatar for JDoggieIII

I am attempting to use a WebBrowser control in C# to display a webpage. I would like my C# application to know when a Javascript function is called within the loaded webpage. Is there anyway to do this? I can't seem to find an event handler for it.

Member Avatar for JDoggieIII
0
381
Member Avatar for slyfox

Hi, Cosidering the following code ....i want to store the output values into an array.. can anyone pliz help......... import java.io.*; import abr.srw.*; public class Prime1 { // This method tests whether a given number is prime or not. public static boolean isPrime ( int num ) { boolean prime …

Member Avatar for Ezzaral
-1
220
Member Avatar for wiredin

I need to make 45 objects of a nested class within my main class. I have tried instantiating the objects inside the main class' data fields and then inside of its default constructor. After being instantiated, i need to add 15 of the objects to 15 more arrays (each object …

Member Avatar for NormR1
0
169

The End.