32,204 Topics
| |
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 … | |
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 … | |
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. … | |
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 … | |
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 | |
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 … | |
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?:-/ | |
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....... | |
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 … | |
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. | |
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 … | |
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 … | |
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.... … | |
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] | |
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 … | |
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... | |
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= … | |
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.. | |
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------> | |
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 … | |
ive already searched the threads... Plz help :( unable to access jarfile C:\Documents and Settings\staff\My Documents\fg8clients.jar | |
[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 = … | |
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 … | |
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, … | |
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? | |
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 … | |
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. | |
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 … | |
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 … |
The End.