3,978 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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; … | |
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 … | |
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[] … | |
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 … | |
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 … | |
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 … | |
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 { … | |
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 … | |
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 … | |
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.*; … | |
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 … | |
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.*; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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; … | |
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 … | |
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); … | |
[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> </td> </tr> <tr> <td> <div align="center"> <font color="#19A1CB" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <span><b>Tic … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.