I would like to ask how to implement the droptarget in jpanel in the GUI interface of netbeans?<br/>Thank you.
248 byte By
YaKa at 2007-11-20 8:12:50
Hello, i'm working with pixels, and i used the function getRGB from the class BufferedImage to get the value of the pixel.<br/>Is there anyway to break the value that the function returns into 3new values: Red, Green and Blue?<br/>Thanks.
423 byte By
u66lan at 2007-11-20 8:13:33
Hello, I need a script that will do this for me: When I MouseOver an image it's supposed to be "highlighted" by fading from 0% opacity to 50% and then back to 0% and to 50% again, and so on. It's supposed to stay like this for as long as the mouse is on the image. Is this possible with jav...
630 byte By
JavaNewb at 2007-11-20 8:13:37
Hi,For a simple RPG program my friends and I are making I need to find a tutorial for dummies on reading/writing files. The file is to save a character stats, health totals and level (all intergers) so that when the program is closed your progress is not lost.I have a basic program hammered out to c...
I'm trying to write an SFTP client, but I'm having problems with the Key Exchange. Verify is always bringing me back false. Here's the code, any ideas (I have my own helper class called Packet which reads in the data from the server) - the algorithm being used is ssh-rsa: cod...
I'm a java newbie. I don't know how to compress/decompress data, please give me an example.<br/>thanks in advance.
In creating applet in netbeans, the code to create object in GUI is automatically generated. If i want to create an object by coding. .where can i do it since initComponent() is not allowed to edit.<br/>Thank you
I've been having this issue and I can't figure it out. I've got a application where a user enters in an e-mail address and password and clicks "login." It then connects to my SQL database to see if that e-mail and password combination exist together. If it does it's supposed to p...
218 byte By
shreyesi at 2007-11-20 8:15:40
hi all,<br/>i am very much new to java<br/>i want to convert database tables to xml files using java<br/>how can i do that?<br/>can anyone explain me the code?<br/>Please help me....<br/>regards,<br/>shreyesi
Is it possible to extend multiple classes from a single class?if yes how?Im trying to get one of my programs to pull information in from more than one class.e.g. Class A requires information from both class B and class C.Class B and class C can not be combined. Other classes extend both B and C but...
372 byte By
martin1 at 2007-11-20 8:16:28
hi all ,i am using a program in which i m getting live data from e-signal account i m retrieving data from server usiing socket then parsing and storing it into hashtable now my problem is that each moment the data is changing how can i store the data in hashtable since for i have to generate differ...
I need to graphically let the user arrange a list of, say, 10 items in any order he wants in an application. I dont care if its click and drag, or select and use up/down buttons to move items on the list, or any other method. Before I go completely out of my way to make one from scratch, I was won...
I have wriiten a function for opening a new browser when the button in my applet is clicked.Here is my code: private void btnAddActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: status.setText("Adding"); int[...
Hello,Can you say me, where I make a mistake.I am writing a proxy.When I read from InputStream in,like: try { byte[] buf = new byte[4096]; int bytesIn = 0; w...
1504 byte By
redgto4u at 2007-11-20 8:17:57
I am triyng to figure out how to get dialog boxes to work correctly. Basically, if the user clicks YES then I have a showmessagedialog box that says "The ticket number is valid" if NO is clicked then it says "the ticket number is invalid". For some reason when I run the code it spits out both boxes!...
2082 byte By
Magus at 2007-11-20 8:18:11
Hi. I'm trying to get JCE to work with the following example using AES in ECB mode (yes, ECB shouldn't be used, but it's what I'm supposed to use): given a clear text String represented by the bytes (in hex) 546578746F2070617261207465737465 and a key 6573736173656E686165686672616...
2097 byte By
ZiggyMon at 2007-11-20 8:18:22
Hello, I know this might be a very simple question for most of you but I haven't coded in Java in almost 5 years now. I'm trying to recall up on it for some project. I started my attempt to refresh on it with the following program====================================================/** * T...
hi<br/>is there any api in java with which we can communicate an application server ? like say jboss ?<br/>regards
348 byte By
eshu2410 at 2007-11-20 8:18:49
class base{public void disp(){}}class anony {base obj=new base(){void start(){}};void call(){base obj2=new base()obj2.start();// is it valid or not if not plz give descobj2.disp();// is it valid....plz give desc}}...
475 byte By
martin1 at 2007-11-20 8:21:09
hi all,i am making an application in which i am retrieving data from e-signal server .i am able to handle that data and display it on console.Now my problem is that in my application i am using jtable and i have to display the data upon the cell of tha jtable .how can i make changes upon various cel...
Ok, heres the situation. I have 2 GUIs that runs perfectly fine independently but they each have their own JFrame. But i want to make one GUI lauch the other one, and when the opperation is complete, go back to the original.Any suggestions on how to do this? and maybe a line or 2 of code to point me...
I have created a simulator program which needs custom UI system. Currently I haven written my own code using only Swing library. One important task is to find out which of the (my) drawn figure is clicked. (When you click a toggle button, which is drawn by Swing then Windows tells Swing where is cli...
Is it possible to have a Java function that returns two arrays? Maybe something very roughly equivalent to<br/>public static double[] double[] MyFunction(){<br/>....<br/>...//some useful code<br/>..<br/>return A;<br/>retrun B;<br/>}
2287 byte By
cb153 at 2007-11-20 8:22:38
I need help with this program that is supposed to "accept two command-line arguments. The first argument is a filename indicating the file that stores the username and password for the program to connect to the database. The second argument is a SQL query that is to be sent by the program to the dat...
I have made a JList and a browse button, when the user click the button and select the files, then it will show the files in the JList. Here is the code for update the jlist DefaultListModel addFileListModel = new DefaultListModel(); private void LoadFileList(String path){ addF...
I am wondering if there is a way to return multiple values at the end of a method.ex:public static int methodName (int variable) { int someName = 0; int someName2 = 1; int someName3 = 2;//blah blah code goes herereturn someName;return someName2;return someName3;}Like that. I get the error "unreachab...
4385 byte By
voidflux at 2007-11-20 8:24:42
The problem i'm having now is printing out the Key along with all the messages...It skips the first element but everything else is working!Because Maps don't support iterators I soon found out, I put all the keys in a set which does support iteerators...here is my code:package alert; impo...
59 byte By
derok at 2007-11-20 8:24:46
Hi everyone<br/>Do you guys also answer jsp questions here?
7753 byte By
magic507 at 2007-11-20 8:24:47
Hi everyone... I'm new to the forum and new to Java programming... I have a project with the following info.1. A projectile is fired with a given initial velocity at a launch angle of 45 degrees. If the trajectory is too short a message will be displayed such that with the given gunnery the tar...
5158 byte By
voidflux at 2007-11-20 8:24:56
Hello everyone...odd problem. I just broke up this code into classes so its not all in main() but now its not working properly.Before I did this, I could telent into whatever port the serversocket was binded to, like: telnet localhost 8008 and I could type in a message, it would spit out the messag...
555 byte By
martin1 at 2007-11-20 8:25:47
hi all,i am making an application in which i am receiving live data from from server and i am storing that data into hashtable through one thread then i am reading data from the same hashtable through another thread and wans to display upon applet now the problem is that i am getting Exception in t...
I am struggling to make this chatGUI workI have a ChatServer class and a ChatClient classand the following classes in a package Chatpack: ChatGUI, Send, Receivemy problem is that nothing come out of the send box on the GUI. Can you help me pleasepackage Chatpack;import java.awt.*;import java.awt.eve...
346 byte By
bzahi at 2007-11-20 8:26:49
Hi,i'm stuck on an assignment.I need to check if a tree is complete binary tree or not,the method needs to travel through the tree and check for two sons...does anyone has a any idea on how to do it? someone told me to copy the tree to vector and from the vector i should try to fdind the sons.....
hey, I am new to using a JTextArea and I have been looking at many examples but I am still having some problems with mine. What I want to do is have the user enter text into a JTextArea rather than a JTextField. However, whenever I enter text, it doesn't seem to wrap to the next line and contin...
119 byte By
Farook at 2007-11-20 8:27:24
Can I design a character based user interface screen with java in unix,, if so any sample program or packages in java.
I would like to send form data from java to a php page. I have referred to the page http://www.devx.com/Java/Article/17679/1954?pf=true and use its class file provided ( http://www.devx.com/assets/sourcecode/7315.zip).I have written something like this private void upload(){ try{...
i need to write class in java named Hotels with 5 abstract functions named SingleRoom, Suite, Lunch, Dinner, Breakfast. Make another class named PearlContinental that inherits from this class in which these abstract functions are implemented. In the implementation of the functions, you simply displa...
5656 byte By
voidflux at 2007-11-20 8:28:11
Hello everyone. I was wondering if its possible to overload the toString() function of the Map datastructure supplied by java.I looked it up and it says:public class HashMapextends AbstractMap ( http://java.sun.com/j2se/1.3/docs/api/java/util/AbstractMap.html)So I looked up AbstractMap and it says:...
390 byte By
redgto4u at 2007-11-20 8:28:12
I am trying to get my project to work. It compiles fine. When I try to run my project called LawFirm2 it says lawfirm2.java wasn't found in LawFirm2 project. There are no main classes found in the box either.I also tried another way by right clicking my Attorney.java class and selecting run. I...
HalloI have a small java application ( java file ) 1. i compiled with netbeans - i got a class file and then i executed this appplication . this application basically reads the OS its running on and returns it. So it returns WinXP . perfectBut when i compile the whole applciaiton and , i had a.jar f...
Hello all! Me again with a somewhat stupid question, but as JavaNewb (fellow classman) was asking in his topic, we need help with Interfaces.I just really need a clarification that I couldn't right out find in the Java Tutorials. Does an Interface work such that you declare class names (such as...
I noticed from various code snippets that it is somewhat conventional for return values of some methods to take the form of integers -1, 0 or 1 eg. return -1 or return 1. return 1 is usually saying the action taken /task done etc is successful and -1 usually is to say it failed ... Usually what can/...
I'm working on a project converting a bunch of C source files into Java ones. Doing okay so far with not much Java background. However, I'm stuck on this C code:static struct e_list_entry{ signed int delta : 8; signed int xy : 24; signed int type : 8; signed int c : 24; struct...
I found that jlist cannot perform drag and drop functions while jtextfield can. However, since I would like to make a function that drag files into the jlist and show the file names for user to select, jtextfield cannot satisfy my requirement.i would like to know if i can put jtextfield into jlist s...
hello,<br/>please look at the following image:<br/> http://www.lottojet.com/files/jtable.gif <br/>i need to create a table just like this one with top header , and left header.<br/>can anyone help me how to do that ?<br/>thanks
HiI am trying to code an algorithm, in which i have to tell if a string is PC(Parenthetically correct) or not.PC string is ="({[]})" Not PC will be ="[{})"what i have till now is:I don;t know how to implement it could someone please help.public class test{ public static void main(String args[]) {...
8439 byte By
martin1 at 2007-11-20 8:31:11
import java.util.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.PrintWriter;import java.net.Socket;import java.net.UnknownHostException;import javax.swing.table.DefaultTableModel;public class tClient{ static int port = 8084; static String...
8102 byte By
redgto4u at 2007-11-20 8:31:16
I have 3 classes. The lawfirm class is my main class which uses client and attorney. What I need to do is instantiate 5 clients and 2 attorney's in the lawfirm class using the client and attorney classes. No biggie. For some reason I keep getting compile errors for all of my String names...ie.....
1434 byte By
derok at 2007-11-20 8:31:17
Hi everyone,I am working with a database from SQL Server and a .jsp,but, I can't pass the a value of the database to my program,example: <input type="hidden" name="price" value="19.95">Float price = new Float(request.getParameter("price"));In this case, I have this input type hidden with...
1777 byte By
qwerty1 at 2007-11-20 8:31:20
How do i prevent number duplication in this program. Basically so that i don't have to enter the same number againhere's the code: import java.awt.*;import hsa.Console; public class BubbleSort_Strings{ static Console c; // The output console public static void main (Str...