3,978 Topics

Member Avatar for
Member Avatar for babylonlion

Hello, I need to re size the square whenever I move the slider; how can I accomplish that? Your time and effort are appreciated. [CODE] import java.awt.*; import java.awt.geom.*; import javax.swing.*; import javax.swing.event.*; public class SquareSliderTest{ public static void main(String[] args){ EventQueue.invokeLater(new Runnable(){ public void run(){ SliderFrame frame = new …

Member Avatar for babylonlion
0
122
Member Avatar for hippo120190

hey people.i am new to java and i am currently constructing a hangman game. the game asks for the user to enter a word(3 or more characters long). then it prompts the user to enter a single character or the complete word in a message input dialog which contains the …

Member Avatar for RunTimeError
0
96
Member Avatar for Web_Sailor

Hi, I am trying to develop an application that has got a Jbutton and allows to search a file and then loads selected line of that file in the JTable. I am able to do that when I hard code it inside the code but when I try to let …

Member Avatar for Web_Sailor
0
135
Member Avatar for gunjannigam

I am trying to read from a text file which of size 1 MB, and contains 5000 lines of data. Following is the code of class which I am using to read from the file [CODE] public class PlayFile extends Timer implements ActionListener{ File filename; BufferedReader out; //float frameid,prev_frameid; public …

0
62
Member Avatar for tknopriest

OK... so I am pretty new to Java and need some help. I'll try to explain as best I can... I am trying to create a frame that will be a "menu frame" and then based on which option the user picks (JButton) it will then run the version of …

Member Avatar for tknopriest
0
77
Member Avatar for Ryujin89

I have created the output for a program that allows a user to input their employee name and number and then their hourly wage and their total number of regular hours and overtime hours. This is my first time working with this type of program in java and I'm having …

Member Avatar for Ryujin89
0
209
Member Avatar for pwk064

I need to change the font size after I click. How can I do that - Thanks! here is the code [code=java]import java.applet.*; import java.awt.*; import java .awt.event.*; import javax.swing.*; import java.util.*; public class JChangeFont extends JApplet implements ActionListener { JLabel question = new JLabel("Who's number one?"); JButton click = …

Member Avatar for peter_budo
0
93
Member Avatar for javanub123

hi, i have a lab monday which requires me to generate random sized squares random poinst. im not to familiar with the random class and the syntax and all that but im guessin i need to use a for loop. if someone can just point me in the right direction …

Member Avatar for javanub123
0
1K
Member Avatar for javanub123

im trying to make my program draw lines from the top right corner of the JFrame which is 400 x 400, to the bottom of it making what looks like a curve but really is just lines. i think i know the basic idea of how to do this which …

Member Avatar for javanub123
0
1K
Member Avatar for rigidboss

Hello All... I have a requirement to create a chat forum.. I cannot use php or other related stuff. I'm not provided with database even.. My idea is that I can use java applet to create a chat window... What ever post which when given, it will be saved in …

Member Avatar for rigidboss
0
113
Member Avatar for DrDeadite

I'm trying to add a memory function, that when you hit the 'M' button, it stores whats in the display into a variable, and when you hit the 'R' button, it retrieves the variable value and displays it and can be used for calculations. Here's my code: [CODE]import javax.swing.*; import …

Member Avatar for DrDeadite
0
122
Member Avatar for moofox6

Hey guys, First time poster here, although I've been trolling for a little while now. I'm in a Java 2 class and having trouble completing a practice program. It's supposed to search files that are given by the user at a command prompt for a specific word also given. Here …

Member Avatar for thines01
0
238
Member Avatar for eggmatters

Hey there, I'm getting ready to release my Beta version of a java project you've all been so helpful with. There is one problem though. I haven't the foggiest idea how to package the jnlp. Where do the compiled libraries reside? Are they part of a binary? What is launched …

0
58
Member Avatar for hanntaa

hey guys im not quicke sure this progrom wont send the string "result" to the JList, something im doing wrong? any help would be great thanks [CODE] import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.util.*; import java.io.*; import javax.swing.*; import java.sql.Array; import java.text.*; public class Q3 implements ActionListener { JFrame …

0
77
Member Avatar for Bluesilver

I need help on an assignment I have. The first part was to write a program that would declare an array with 150 elements, assign the "#" symbol to each element, then print the elements in such a way that it would spell a letter (in this case, "A") within …

Member Avatar for BestJewSinceJC
0
101
Member Avatar for hanntaa

hey guys i was wondering if someone could help, i have to create an address book in java that can add, delete, search as well as import details from a file. so far iv got the GUI down (ish) iv set it over 2 frames, one to edit the data …

0
83
Member Avatar for hanntaa

hey guys, i was wondering if anyone could help, basicly at the moment (for the last few hours) iv been tring to find a way to align an container, to enable me to have my current work on one side (left or right) and a JTextArea on the other. the …

Member Avatar for kinger29
0
167
Member Avatar for geek_till_itMHZ

I need to make multiple action listeners for 4 radio buttons and a regular button. They all need to call different methods from another class I currently have [CODE]Import javax.swing.*; import java.awt.*; import java.awt.event.*; public class CardGameCH15 extends JFrame { public CardGameCH15() { super("Card Game"); add(new CardTable()); } public static …

Member Avatar for geek_till_itMHZ
0
183
Member Avatar for adcodingmaster

i m making chess in java swing and does not getting how to implement[B][I][U][COLOR="Red"] check & checkmate condition.[/COLOR][/U][/I][/B] any sugessions plz thnx in advance

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for adcodingmaster

hi all [COLOR="Red"]i m making chess in java and have a problem. Plz if u can help me out.[/COLOR] [B][I][I][I][U]Problem is[/U][/I][/I][/I][/B] when i add a JPanel to a JFrame it sets the size of JPanel given by me in the code. but when i add another JPanel then it automatically …

Member Avatar for walid faraj ali
0
183
Member Avatar for babylonlion

Hi guys, The following program works the way I want it to but there's one small problem; when it loads, it doesn't give a blank frame. It want it to show the output after I click on the blank area. Help me please. [CODE] import java.awt.*; import javax.swing.*; import java.awt.event.MouseAdapter; …

Member Avatar for babylonlion
0
175
Member Avatar for Web_Sailor

Hi, I am trying to create a button group which can give me both Jcheckboxes as well as Jbuttons. The problem is that I am creating a button group and not able to fit the checkbox criteria into it. Actually I want to create 2 radiobuttons followed by one checkbox …

Member Avatar for Web_Sailor
0
148
Member Avatar for babylonlion

Hi guys, I need to display "Java Mug" (in red) inside the mug I created in the following code. I spent hours working on it but couldn't get anywhere. Can you guys help me please? [CODE] import java.awt.*; import javax.swing.*; import java.awt.geom.*; public class DrawJavaMugTest { public static void main(String[] …

Member Avatar for quuba
-1
256
Member Avatar for _dragonwolf_

This project is similar to, but not exactly like, my phonetic project. I am having to construct a GUI and have done so. I have been able to get everything except one part. What I need it to do is: 1) User inputs a string (this part works) 2) When …

Member Avatar for _dragonwolf_
0
243
Member Avatar for Potty391

Hi all, I've been working on a Java guessing game, similar to hangman which rewards you with a picture using the Gogga class (developed by the people who wrote my IT textbook for Grade 10, also I removed gogga for this website, since I doubt you'd be able to find …

0
210
Member Avatar for Sandar Khin

Hi all. pls help me.I repair a program for my need.At that time Text are not appear.Original progarm is here. [code] import java.awt.Color; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Timer; public class MarqueeFrame …

Member Avatar for Ezzaral
0
165
Member Avatar for vortex24

Hi, I am working on code to have a drop down menu from which you can pick items and add a button with that course. Unfortunetally, I can't get the button to display. And help is greatly appreciated. [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ComboBoxFrame extends JFrame { …

Member Avatar for BestJewSinceJC
0
91
Member Avatar for Sandar Khin

Hi all, Pls help me .I want to make multile JLabel or JTextField with multiple Link in Marquee.I can do only one.Here is my code [code=java] import java.awt.*; import java.io.IOException; import java.util.*; import javax.swing.*; import java.awt.event.*; public class MovingText extends JFrame implements ActionListener{ JLabel label; JLabel label2; JLabel label3; public …

0
141
Member Avatar for geek_till_itMHZ

I have a Java Program that I need to create that will show five random images selected form my image folder of 50 images. upon clicking a button the program should select 5 new random images. I have most of it figured out except for my ActionListener. Is it possible …

Member Avatar for Ezzaral
0
163
Member Avatar for treyd

I have to write a program that has a tic tac toe board. When you click it, it should go from one image to another. My code compiles fine, but it doesnt run. I get some errors: Exception in thread "main" java.lang.NullPointerException at TicTacToe3.<init>(TicTacToe3.java:27) at TicTacToe3.main(TicTacToe3.java:41) My code: [CODE]import java.awt.*; …

Member Avatar for treyd
0
130
Member Avatar for eggmatters

In Design mode in NetBeans IDE, I had a palette with all of my AWT and Swing controls and some netbeans that I can drag and drop onto the Jframe I'm designing, I accidentally closed it. I am not seeing a menu option anywhere to add that palette back as …

Member Avatar for eggmatters
0
319
Member Avatar for YingKang

This code outputs the result in console. I want to implement a Swing JFrame, producing output readable by user. Do I have to change all my code if I want to use JFrame? Can anyone help? I am not familiar with JFrame at all. Thanks : ) [code] import javax.swing.*; …

Member Avatar for masijade
0
198
Member Avatar for amitcs100

I am doing project on printing a passbook of bank in which i have 8 fields those are transactiondate, particulars,chequeno,debit,credit,balance,print and serialno and i wanted to print that in passbook and print is a boolian type if i mark on one row it must print the other rows present in …

Member Avatar for BestJewSinceJC
0
198
Member Avatar for topest1

Hello All, I am developing Chat Application, But facing a problem in displaying Chat text [CODE] public void appendText(String text) { displayChats.replaceSelection("\n"+text); displayChats.setCaretPosition(displayChats.getDocument().getLength()); //Scroll to bottom } [/CODE] Works fine while i append the text to JEditorPane(displayChats). But when I use setEditable(false); (so that user cannot edit it). then I …

0
98
Member Avatar for CuteCat

I don't know what to do... I've been trying for weeks to figure out the problem. You see, I'm supposed to make a game, as a project for school. Since it's going to be a rather large game, I decided not to flood the main file with a bunch of …

Member Avatar for CuteCat
0
192
Member Avatar for sush27

hi... i am new to this community, lately i was looking for some help in my code and this website came to my rescue in many topic. i am just implementing the menubar in swing, can somebody help me in my code. [code] import java.lang.*; import java.awt.*; import java.io.*; import …

Member Avatar for peter_budo
0
164
Member Avatar for JavaNoobie1

Hi everyone! I need a little help with while loops please. I tried to create a class within my CD class that repeats the input of the CD info and the output of the CDs value at maturity until the principle of 0 is entered. I think I did this …

Member Avatar for BestJewSinceJC
0
100
Member Avatar for Mykd

Hi The timer works fine when you run it alone, there is a set time befor it exits, 3seconds. But when you open it from the previous window, the timer doesn't start or exit. (The purpose of this is on the previous frame of GUI, the user clicks the exit …

Member Avatar for quuba
0
96
Member Avatar for eggmatters

Not really sure how to phrase the question. Essentially my issue is this: I have a Form that when the user clicks a button, it invokes a JFrame that populates a datatable with a sql query. The datable frame also has a button. The user can select a cell in …

Member Avatar for Ezzaral
1
138
Member Avatar for Web_Sailor

Hi, I am working on creating a jradiobutton group using JTable. Here is a brief definition of the problem. My program gives an output like this:- [CODE] Questions Answers 1 radiobtn1 radiobtn2 radiobtn3 2 radiobtn1 radiobtn2 radiobtn3 3 radiobtn1 radiobtn2 radiobtn3 [/CODE] I am able to set horizontal control that …

Member Avatar for peter_budo
0
527
Member Avatar for Blondeamon

Greetings i have created the above class to create rooms and exits of the rooms. That way every room is linked to another room and i can move between them. Now what i want to do is to add an image to every room that is stored inside the class. …

Member Avatar for quuba
0
133
Member Avatar for Sandar Khin

Hi all, I have two programs.One is for scrolling text.Code is here [code] import java.awt.*; import java.awt.event.*; import javax.swing.*; class MarqueeTest { public static void main(String[] args) { MyFrame frame = new MyFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } class MyFrame extends JFrame implements ActionListener { private ActionListener listener; private Timer t1; …

Member Avatar for quuba
0
134
Member Avatar for Java-newb

I am getting errors in my action listener brackets that I do not get, can someone help me please?? My buttons are not working, not sure what's happening. plus when I try to write [code] newGUI();[/code] I get another errors saying it cannot find the symbol, but my method is …

Member Avatar for javaAddict
0
138
Member Avatar for Sandar Khin

I have a program. Here import java.awt.*; import java.awt.event.*; import javax.swing.*; class MarqueeTest { public static void main(String[] args) { MyFrame frame = new MyFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } class MyFrame extends JFrame implements ActionListener { private ActionListener listener; private Timer t1; public MyFrame() { Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); setSize(d.width,d.height); …

Member Avatar for Sandar Khin
0
175
Member Avatar for romilc

[CODE]<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import = "javax.swing.*" import="DefaultNamespace.user"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Play Tic-Tac-Toe</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td>&nbsp;</td> </tr> <tr> <td> <div align="center"> <font color="#19A1CB" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <span><b>Tic …

0
63
Member Avatar for YingKang

the program draws lines, but every time I draw a new line, the previous one disappears. How can I let it show all the lines drawn? I know my problem is in the array, but how to fix it? thanks for help [code] import javax.swing.JPanel; import java.awt.*; import java.awt.event.*; import …

Member Avatar for YingKang
0
824
Member Avatar for verilu

So, I'm stuck trying to figure out how to move the object. I am using the keyboard as a call to Key Event to move the object. Right now, it isn't moving. I'm pretty sure that this is correct. [CODE]import java.awt.Color; import javax.swing.*; import java.awt.Graphics; import java.awt.Image; import java.applet.Applet; import …

Member Avatar for nambro
0
110
Member Avatar for Java-newb

I am a student really struggling with Java and needless to say, I am pretty isolated from anyone who gives a care enough to help me, I am on my 8th week and really struggling with GUI's I have some code written, but the gui will not display, I am …

Member Avatar for Java-newb
0
175
Member Avatar for runee1000

Hi, I just started learning java, so my skills are quite limited and I have yet to learn many many concepts. Right now, I am trying to create a hangman game(which as you can see is still incomplete). The problem I get is, the word being "mystery" when I guess …

Member Avatar for BestJewSinceJC
0
135
Member Avatar for treyd

I have to write a program that diaplys a tic tac toe board with random x's and o's. I have having severe issues with the random part. I also dont know what to put for arguments in the JButton methods, but I think my issues are realted. Any and all …

Member Avatar for BestJewSinceJC
0
164

The End.