35,618 Topics

Member Avatar for
Member Avatar for Muhammad Anas

I am designing a very basic form in which I am using GridBagLayout to position and size the GUI components. All the components get sized and positioned exactly as I expect from my code except the two radio buttons named "noRadio" and "yesRadio" respectively. I want them to appear next …

Member Avatar for Muhammad Anas
0
621
Member Avatar for Fotis_13

Hi. I cannot explain my question very well. I have an array of objects. Can i perform a search in this? Check the following code as example: public class test1 { public static void main (String[] args){ test2[] array = new test2[2]; for(int i=0;i<2;i++){ array[i]=new test2(); } int a=1, b=2; …

Member Avatar for Fotis_13
0
205
Member Avatar for radhika1990

//This is the package file package radz1990; import java.io.*; import java.util.*; import java.lang.*; public class radz1991a1 { BufferedReader ob=new BufferedReader(new InputStreamReader(System.in)); Scanner obj=new Scanner(System.in); public String name=new String("0"); public String patientid=new String("0"); public String prescription=new String("0"); public String Illness=new String("0"); public String Address=new String("0"); public String ladate=new String("0"); public int …

Member Avatar for NormR1
0
191
Member Avatar for sonicx2218

I made a creature composed of shapes in a Java Applet. I want to basically copy and paste the creature I made so I have say 7-8 copies on the same applet. but in different locations. Is there an easy way besides copying the entire code, and moving each coordinate …

Member Avatar for sonicx2218
0
406
Member Avatar for javaprog200

Hello, The following program computes the value of Pi using the Hit/Miss method. Since I am doing all the drawing in the JPanel, I am not calling super.paintComponent(g). The program works well, but since I am not using the super.paintComponent, it does not draw the background. Is there any way …

Member Avatar for javaprog200
0
404
Member Avatar for Johannady2

*This program is supposed to printout all the first letters of the Strings enterned in an Array. Which works. but when I added some code to convert the first letters to uppercase, there's an error.* I put a comment in the code where the error is. what's wrong with that …

Member Avatar for Johannady2
0
285
Member Avatar for namdaemun

hi, I'm currently building a game and stuck at the paintComponent method. I'm trying to add 3 graphic buttons to the JPanel but the paintComponent does not execute (all I get is gray window) here's my code : public class TwinMoonTowers extends JPanel implements ActionListener{ private class TMTMenu extends MouseAdapter{ …

0
115
Member Avatar for Stjerne

Hello guys, There is a thing I need help with. When I run my program, and the window shows, I want focus on the textField. Like Google, when you enter Google, you get focus on the search panel so you can search. My program got a simple search engine with …

Member Avatar for Stjerne
0
178
Member Avatar for marleyB

<?xml version="1.0" encoding="ISO-8859-1"?> <project name="ant_template_core_java" basedir="." default="info"> <!-- Properties files --> <import file="../masterbuild/masterbuildproperties.xml"/> <import file="../lib/libproperties.xml"/> <import file="../implementation/implementationproperties.xml"/> <import file="../api/apiproperties.xml"/> <import file="../junittest/junittestproperties.xml"/> <import file="../javadocs/javadocproperties.xml"/> <!-- Ant task files --> <import file="../implementation/implementation.xml"/> <import file="../api/api.xml"/> <import file="../junittest/junittest.xml"/> <import file="../javadocs/javadoc.xml"/> <import file="../masterbuild/masterbuild.xml"/> <import file="../log4j/log4j.xml"/> <!-- Make directory files --> <import file="../masterbuild/masterbuildmakedir.xml"/> <import file="../implementation/implementationmakedir.xml"/> <import …

0
39
Member Avatar for Johannady2

I don't understand why it just prints numbers. /* This program converts the first letters of the entered strings for an array to uppercase*/ import java.util.*; import java.lang.String.*; public class myfirstarray{ static Scanner scan = new Scanner(System.in); static String str1, str2,str3, str4,str5; public static void main (String[]args){ String[] items = …

Member Avatar for Johannady2
0
180
Member Avatar for marleyB

An example of a multi-tier application where each tier of the application throws its own exceptions that are caught by other tiers of the application.

Member Avatar for TrustyTony
0
70
Member Avatar for goyal_2485

i have to decrypt a frame on my server. encrypted frame is coming from client device through GPRS on socket.encryption is done with "TripleDes" and with a given key.same algorithm and key i am using n server side. frame is a combination of Hex and Ascii String. problem is when …

Member Avatar for goyal_2485
0
604
Member Avatar for marleyB

How to import Logging class..Because when i import log4j.xml the program is outputing an Error "unknown configuration log4j"

Member Avatar for prachi69
0
55
Member Avatar for Kathy0410

I have this program I'm writing. I need help with the bet part of the program. I'll give you an idea of what I'm doing: The player starts with $500. He can bet between 0 and his current amount left on next turn. If he bets 0 the game is …

Member Avatar for NormR1
0
662
Member Avatar for cecsFTL

For the assignment we're suppose to add a findFirst, findNext, and addElement method to the given class and test them. I manage to get the findNext and addElement working but not the findFirst. Here's what the findFirst suppose to do "Method findFirst(T item) searches for and returns the index of …

Member Avatar for NormR1
0
137
Member Avatar for GTech4life

Can some one help me with my programming project, it is supposed to loop. If the number is even output comes out even and vise-versa. Can someone please tell me what is wrong with my code. Errors "3 errors found: File: C:\Users\Kaamil\evenodd test.java [line: 1] Error: The public type NumberEvaluator …

Member Avatar for TrustyTony
0
281
Member Avatar for kelvin.njuguna

/** * @(#)SavingsAccountTest.java * * SavingsAccountTest application * * @author Kelvin Njuguna * @version 1.00 2012/4/24 */ public class SavingsAccountTest { public static void main(String[] args) { double interest1,interest2; double newBalance1,newBalance2; SavingsAccount.modifyInterestRate(0.04); SavingsAccount saver1 = new savingsAccount(2000.00); SavingsAccount saver2 = new savingsAccount(3000.00); for(int=0;i < 12;i++); { system.out.printf("Month %d:\n",i+1); interest1 = …

Member Avatar for Johannady2
0
96
Member Avatar for Fotis_13

Hi! I have one small question. Is that possible? public class test1 { public static void main (String[] args){ test2 client = new test2(); test2[] call = new test2[1000]; int x =2; call[1].add1(x); } } public class test2 { void add1(int x) { x = x+1; } } Sorry for …

Member Avatar for Fotis_13
0
411
Member Avatar for effBlam

Im stuck on how i shlud set up my Maze class in order to get started with solving it recursively. The maze has values stored into a two dimensional array " char[][] maze" and from there im stuck. heres my codes so far: public class Maze { char start; int …

Member Avatar for NormR1
0
195
Member Avatar for hszforu

i have been coding a client server program to calculate factorial of a no . The client will pass the no to the server whose factorial is to be calculated. Now the problem that i am encountering is that no matter what value i am passing to client(variable msg in …

Member Avatar for hszforu
0
4K
Member Avatar for hadi1370

hello friends! I want to participate in soccer simulation competition and i don't have any info about its programming. i want to use java. is there anyone help me? Thank you.

Member Avatar for Miladsob
0
116
Member Avatar for charmcity04

I need to create a program that will read from a file and output the information into a JFrame. I know how to create a program to read a file, but I just need some help reading the file to GUI. Any help would be appreciated! package ism3230_ch6assignment; import java.io.*; …

Member Avatar for NormR1
0
290
Member Avatar for jonny93

Hello, I'm new to this site, and i really need help with something. I have been working on a checkerboard project for my second programming class, and now I'm stuck. I now how to set the icons, but now I am absolutely confounded as to how I move the icon …

Member Avatar for NormR1
0
2K
Member Avatar for shifat96

I need help for another one of my assignments for CS Class. On the rubric, one of the part said: > all characters are shifted right by two positions and the last two characters becomes the first two characters The condition is that the string has to be entered by …

Member Avatar for shifat96
0
2K
Member Avatar for effBlam

Pretty much i have to read a txt file which contains a sample maze in it as so: 4 5 ~~~00 00S~0 E~0~~ 0~~~0 the first number is the number of rows and the second is number of columns. Im having trouble figuring out how to store just the "maze" …

Member Avatar for NormR1
0
507
Member Avatar for Diogo Martinho

Hey guys, I'm about to start a project in which I'll have to implement something simillar to an ordinary excel sheet, and one of the aspects that will be focused is related to the creation/implementation of Macros which allow me to record a number of actions and then perform those …

Member Avatar for JamesCherrill
0
164
Member Avatar for javaprog200

Hello, The following program displays two images (ImageIcon type) inside the JTextArea. Is there a way I can make both of these images transparent sothat what I type on them is visible? Thanks in advance! import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import java.io.IOException; public …

Member Avatar for JamesCherrill
0
203
Member Avatar for fo2sh

Any body can help me with this error I am getting this error: C:\Documents and Settings\Fuad Damra\Desktop\TCPDayTimeServer.java:33: variable out might not have been initialized out.println("Server Sent Average: "+Avg); ^ 1 error When I am trying to execute this program: [CODE]import java.io.*; import java.net.*; import java.util.Date; public class TCPDayTimeServer { public …

Member Avatar for NormR1
0
908
Member Avatar for zuzzles

So i came across this issue that I can run my applet fine and it creates my file (exe) until i attempt to do so in a browser (firefox, IE, etc). Its signed and asks for permission and gives no erros but it doesnt write to the file I want …

Member Avatar for JamesCherrill
0
312
Member Avatar for sweets

Hello folks,I have implemented steganography for Least Significant Bit(LSB) 2 bit which works for any kind of carrier files i.e,basically i can hide image/text/video in any of these files. 1)Now i need to do some improvement for the project i.e, implementing steganography using any other method which is more efficient …

Member Avatar for sweets
0
134

The End.