32,199 Topics
| |
//main method int number = 1; int num = 3; details[] Darray = new details[number][num]; String name = JOptionPane.showInputDialog(null, "Enter the name", "Enter details", JOptionPane.QUESTION_MESSAGE); String DOB = JOptionPane.showInputDialog(null, "Enter the DOB", "Enter details", JOptionPane.QUESTION_MESSAGE); class details // i have default construtors aswell String getName(){ return name; } heres the … | |
I need help with breaking out of a loop. I know it's something simple, but I can't remember. Here's my code. for(count = 0; count < inputArray.length; count++) { inputArray[count] = JOptionPane.showInputDialog( null, "Please input a name or exit: ", "Input Name", JOptionPane.QUESTION_MESSAGE); if(inputArray[count] == "Exit") { break; } } | |
Hi, I have a project where we need to scan each pixel from an image. Somewhere in the image there will be a 10x10 red pixel and we need to draw a circle around it. This is the code I have so far: (but I'm having trouble figureing out the … | |
I am stuck trying to figure out syntax errors in program. Would appreciate help. Thank You In Advance :D These are the errors: C:\My Documents\myJavaFiles\Homework 2\Inventory.java:40: illegal character: \92 System.out.println("Item Already Exists --" ' +item + '); ^ C:\My Documents\myJavaFiles\Homework 2\Inventory.java:40: unclosed character literal System.out.println("Item Already Exists --" ' +item … | |
Hi everyone, I have a small program in which i try to encrypt a zip or jar file but here is the thing in that eveything can be decrypted and encrypted without any problems but the archives(either a jar or zip file) after decryption later cannot be read. This does … | |
Hi everyone, I am trying to add an undo listener to a jtable but could not get it to work. Does anyone know how to add a undo function to a jtable assuming the default cell editor component is a jtextfield? A small code sample would be helpful Any help … | |
I'm using the Fly-out Menus provided at [url]http://www.sharepointcustomization.com/resources/codesamples/Menus/default.htm[/url] . The code at my site works fine if the pages using the menu are in the root directory ( the initmenu.js and menu.js along w/ all the .gif's that make up the border are in a subdirectory of the root) I'm … | |
i want to make a simple applet in which a ball bounces using Runnable interface ..i know how to draw a ball , i know the translate() to change its location method but what i dont understand is how to use the Runnable interface's run() method fit into my applet … | |
Im currently using method getKeyText() and getKeyCode() like this How do you listen for * - and + with keylisteners. / is the only one that works atm the rest won't get recognized for some reason if(event.getKeyText(event.getKeyCode())).equals("/")){ //do something } that method works, but when I try using a + … | |
Hello everyone, I am looking for peer to peer programming resources (open source projects, tutorials or papers). I am wondering where can I find valuable ones especially Java based technologies. Thanks in advance, George | |
When you have to write your own class, is it ok to call the scanner class in your class? | |
Hello there, I am in desperate need of some help. I cannot seem to access anything that takes Java. A radio programme, diagram for booking airline seats, and now I can get into a btinternet e-mail account but am unable to read the e-mails. I did post this problem some … | |
Hi everyone, I have a question about the java multi-platform print dialog. I am able to show the dialog but here is the kicker in i am unable to select the printer properties on the print dialog. The printer properties button seems to be always disabled. This does not happen … | |
Hi everyone, I have two questions about the java multi-platform print dialog. The first question is about the printing of double-sided which is supported by some high end printers but the thing is that when i want to change the properties so that the user can decide if he wants … | |
I have a JMenu with some radio buttons...For some reason, when I click the stupid things, they won't do anything...and by that, I mean they want change their state to being clicked(as in the circle being filled)..It's like they are disabled...I'll post the snippets of code with them in it: … | |
Let's say I have two classes, Class1, and Class2..... Class2 creates and instance of Class1 and calls one of it's methods like this: [Code] Class 2 { Class1 c1 =new Class1(); c1.myMethod(); } [/Code] Now, that would work...But, could you have just the class variable instead of the class instance … | |
Hello everyone, Suppose I have a method which is a synchronized method (for example, method Foo in the following code block), and in this synchronized method another method which is not synchronized is invoked (for example, method Goo in the following code block). I am wondering when executing in Goo … | |
Hi everyone, I have a question about key events. In the key events they have some values called as follows: static int KEY_LOCATION_LEFT static int KEY_LOCATION_NUMPAD static int KEY_LOCATION_RIGHT static int KEY_LOCATION_STANDARD I have seen the api and the explanation of what the above values represent and still do not … | |
I took a course in C and now im into java. I never created anywith graphics in C. I need to finish a program in C that makes a red ball appear on a blue background and then move down and up the screen. Any information of how to at … | |
Can applets display images on the viewers hard drive somehow? If so how would I do that? And if I dont know the filenames but I know the directory, is there a way to do it? | |
Well once again I have some trouble getting my lab to work. I am currently having trouble on an algorithm that is supposed to count the neighbors next to a cell in a Two-dimensional array which is supposed to resemble with the algorithm of Conway's Game of Life. For some … | |
Hi peeps, I was wondering if anyone could help me. Im using a [B]JEditorpane[/B] to display a html page in. What I want to do is to change the font colour of the html page. I have tried to use the [B]setCaret()[/B] method, but to no avail. Anyhelp would be … | |
Hi everyone, I am trying to save the contents the of the jtable together with all its fonts and everything else. The program compiles without any errors but When i try to save the contents of the JTable an exception is thrown in the tablesaveas method in the below method … | |
I had installed MinGW-3.2.0-rc-3.exe and i was trying to compile a simple code: [code] public class HelloWorld { public static void main(String args[]) { System.out.println("Hello, World"); } } [/code] then i typed this command under vim, !java d:\progsaved\java\jdk\HellWorld, before i typed this !javac d:\progsaved\progsaved\java\jdk\HelloWorld.java to generate class file. The errors … | |
I have the datasoure and drivers set up, but for some reason this code is not updating the database. [Code] import java.sql.*; public class TestCreateCoffeeTable { public TestCreateCoffeeTable() { } public static void main(String[] args) { try { String createStatement; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String dataSource = "jdbc:odbc:Coffeebreak"; Connection con = DriverManager.getConnection(dataSource); Statement … | |
Hi everyone, I have a question about threads. Consider the below program [code] public class test { public void test1() { System.out.println("Test 1"); } public void test2() { System.out.println("Test 2"); } public void test3() { System.out.println("Test 3"); } public static void main(String args[]) { test a = new Jtest(); a.test1(); … | |
Hi I need to write a method that will rotate the elemnts in an array by a factor of k. ie shift each element k places to the right. Here is the question i have been set [B]In the class ArrayLinearList a linear list is represented in an one-dimensional array … | |
Hello everyone, I want to know which method owns the lock of a specific object (some of my methods are blocked because they can not achieve the lock of a specific object, and I am wondering which method owns the lock to solve the deadlock issue). Does anyone know how … | |
Hello everyone, I am looking for a light-weighted Web proxy in Java which can enhance the performance of my web server. I want it to be written in Java so that it can be used on any platform. I want to place the Web proxy between a specific Web server … | |
Hi everyone, I have a jtable and i need a way to be able to merge or to split the cells(both the rows and columns) selected by the user. I have seen the table model and jtable apis' and there seems to be nothing about this. I would appreciate it … |
The End.