31,001 Topics

Member Avatar for
Member Avatar for bboris

Filterable `AbstractListModel` uses `originalModel` of `JList` as source and excludes those items from `originalModel` that matches exclude criteria specified by given regex. It also allows reusing same model (with filtering capability of course) for multiple JList components. It also registers as `ListDataListener` to `originalModel` model to be able to relay …

0
62
Member Avatar for anuj_sharma

Hi, I've created a small application that allows the user to capture the screenshot and save the image at a user defined location. It also allows the user to capture the screenshot of the active window as well. The issue is with the active window. I have learnt that Java …

Member Avatar for anuj_sharma
0
337
Member Avatar for jimoaks

Hello, I am having some trouble writing this java GUI. First in the win1, i cannot get the start and exit button to the bottom of the page along with the jlabel into the center. Next for win2 i cannot resize the "go here" button at the bottom of the …

0
302
Member Avatar for Torf

I have been trying to teach this myself, but I judt don't get it. I have 10 books with ISBN number, title, name of author. The linked list should display the books sorted by ISBN. I hope this collections.sort is correct: import java.util*; public class Sort { public class Sort …

Member Avatar for Torf
0
225
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
500
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
199
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
183
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
276
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
397
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
281
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
113
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
154
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
38
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
177
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
67
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
591
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
54
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
636
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
132
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
277
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
92
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
406
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
192
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
100
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
285
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
502
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
161

The End.