32,204 Topics
| |
I want in java applet if a user clicks on a rectangle another one is draw. [CODE]import javax.swing.; import java.awt.; import java.awt.event.*; public class stuff extends JApplet { public void paint(Graphics g) { super.paint(g); g.drawRect(40, 40, 200, 200); if(g.isSelected()) { g.drawRect(20, 20, 50, 50); } } }[/CODE] | |
Greetings, Hmm, Im not sure Is this the right place to ask this question, Well If im wrong please correct me. Im working in a company as Java programmer that also provide professional training for Java and two of my trainees have created "Stick Snake" and "Snake and ladders" game … | |
I have a class which extends JDialog which by default has some text on it and a couple of buttons. Most of the instance of the buttons are "Ok" and "Cancel" so the two buttons have their bounds set. If I try to change the label on the Ok button … | |
Hello, I'm a biologist trying to do some bioinformatics, so new to Java and new to this forum. I've searched all over the forum for previous threads on this topic, but can't find an answer that has helped me. Apologies if I've missed something already posted that may help solve … | |
I don't know why. At all. Just that it won't repaint! My code: [CODE]import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import javax.swing.JPanel; @SuppressWarnings("serial") public class Frame extends JFrame implements KeyListener{ JPanel content; int W = 200; int H = 200; public Frame(){ setSize(700,250); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); content = new JPanel(); … | |
I have several buttons in my applet, however in certain case i use fillRect function to draw my whole applet go black, but i want to leave one Jbutton visible. The fillRect function hides my button, but the button comes visible if i move mouse cursor on top of it. … | |
Hello everybody I have a problem with my code. On two lines (14 & 17) I get this error: cannot return a value from method whose result type is void. But I don't have add void to my class. Thanks in advance. Greets MeandJava Here's my code: [CODE]package oop_po2; import … | |
Evening all, I have created a program that reads a Data Base contents, displays the information, prompts the user to press enter, then in theory they should enter an account number and that specific accounts details be deleted from the data base. Finally the contents of the data base should … | |
Hi there! got some problems. I've developing a multiplayer game there's a class called userServer, that use a file to handle all incoming information. but I can't write to the file for some reasons. here's the code: [CODE] /** * @(#)userServer.java * * * @author * @version 1.00 2011/2/16 */ … | |
Hey Guys i wonder if any one could help me in setting a background image for JDesktopPane instead of changeing background colors... i'll be gratefull for Detailed Describtion of any written code Thank you people in advance. | |
Hi there! I have some problem with java. I developing a multiplayer applet, there a class called userServer registry new users and logging in other users. the problem is, that I don't know how to append in a array. [CODE] user Users[]; int cnt=0; Users[cnt] = new user("emorjon2", "password"); cnt++; … | |
Hello Guys, I know how to draw line and shapes but how can i draw a parabol??? ( i need a 2D line) Any suggestion or pointers are appreciated! | |
Hi, I urgently need a java applet to make fractals like this one: [URL="http://www.fractalposter.com/fractal_generator.php"]http://www.fractalposter.com/fractal_generator.php[/URL]. Please can someone give me the code? Thanks Gheter | |
hello everyone, got issue regarding reading duplicate records in a text file... i need to read the file and look for any duplicates data/keys in the text file and write them to another file (all the duplicates records)... how can i do that, in looping...:-/ any help...:) thanks! | |
hi, i am using ITEXT to create Pdf File . i want to reduce spacing between lines in pdf file is this possible if it is possible then how can i do that. thankx | |
Hi there, I am a newbie in this forum,:) I have problem with the R-SVD java for object tracking in video, Any body can help? the references or code maybe... here a give the file of formula of R-SVD for object tracking, I feel difficult to understand and make the … | |
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.skynet.simpleHttpServer; /** * * @author Gryffy */ /* "Copyright (C) 2001,2005 by SkyNet Corporation \n"+ "\n"+ "Redistribution and use in source and binary forms, with or without\n"+ "modification, are permitted … | |
i am having trouble with this code. It does not let me compile in eclipse but there seems to be no error? Any clue where my mistake lies? thank you [CODE] package useToken; import java.io.*; class readFile extends StreamTokenizer { readFile(InputStream in ){ super(in); } public static void main (String … | |
Why eclipse is giving me different answer every time with same program code?is it stack overflow or something?plzz help e fellow programmers. (im using the input box) | |
I'm trying to run through a file and add each string in the file to a string array. My code yields the error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at StudentLAM.main(StudentLAM.java:14)" Why doesn't this work? Note: I cannot use ArrayList. My error-yielding code: [CODE] private Scanner index; int cell = … | |
I have a JSP page that has two pieces of data that I need to send to a page on another domain via post when a button is clicked. My original iteration was just having the two pieces of data in 2 hidden fields and when the user clicked a … | |
[B]I just started to learn Java a few weeks ago but gave up on it after hours of attempts and my code didn't work. Here is my input: [/B] [CODE]class JAVA { public static void main(String Args[]) { System.out.println("Hello World"); } }[/CODE] I saved it as JAVA.java and tried to … | |
This is the program I'm working on and I'm completely lost A Pythagorean triple is a set of numbers A, B, C such that A2 + B2 = C2. Write a subroutine that determines if 3 given numbers are a Pythagorean triple. The subroutine should print out an appropriate comment … | |
Ok, so basically i am just trying to pull plain text from a website. basically it will display a person's Runescape stat's in text form. here is my code so far on how to get the url for the page. [code] private void statsButtonActionPerformed(java.awt.event.ActionEvent evt) { String oldrsn = rsnTextField.getText(); … | |
Hi, im new to jsp and have made a few pages, and can display them using Tomcat, ive made a page counter and managed some validation of a form, but i cannot get this to work: i have a form where you can select a product, then type in the … | |
Concatenate a substring of the original string sentence starting from index 0 and ending before the middle Character(s). Use the substring() method. Use an if statement to account for even or odd, the end index that you need substring()the end index that you need for substring() will be different public … | |
I am a beginner in Jpcap. My problem is as follows:- i am trying to send a TCP packet but unable to receive it. The code for sending Tcp packet is as follows. I am working on Windows XP. hoping for reply. [CODE]//code for sending import jpcap.*; import jpcap.packet.*; import … | |
hey i need some help with my assignment am a seriose beginner i need to create a program using arrays that prompts the user to write a sentence and then prints outs the word and the number of times its appearing..i don't know where to begin please help :( | |
What is wrong with my code? I'm trying to add a list of paths to a DefaultMutableTreeNode... I'm not getting the result I expect...can anyone help why?... [CODE] public static void main(String [] args){ List lst = new ArrayList<String>(); lst.add("a/b"); lst.add("a/b/c/d"); lst.add("a/b/c"); DefaultMutableTreeNode node = new DefaultMutableTreeNode(""); DefaultMutableTreeNode traverser = … |
The End.