32,199 Topics
| |
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 … | |
hi, I've got a really long String of bits, like: "0010101011101010011011011010100110101010110101..." And I want to chop it into pieces of eight and make bytes out of them, in an array. what would be a performant way to do this? Thanks Ephron | |
I have this code and it works. It prints out the number, product, and sum, but I need it to be able to work with more than one number. For example if enter 45 6 70 I need it to say Numbers: 45 6 70 Sum: 121 Product: 18900 How … | |
Right, I wasn't sure whether to put this here or in the java forum (since I'm trying this in java) but in the end I figured it is probably a general coding question. Hope I got it right :) So, about object names :) I'm trying to do the c++ … | |
Hi, I have created a small appication to run a number of self extracting archives depending on the option selected. I have the program working and all is going to plan. At the moment my program calls the slef extracting zip by pointing to the location on the hard drive … | |
I just try to calculate 5.3 - 5, and the answer is a bit off. this is the code: [CODE]double answer = 5.3 - 5; println("answer = " + answer);[/CODE] and the output is: "answer = 0.2999999999999998" instead of 0.3. I use Eclipse on win 7 32 bit as a … |
The End.