3,978 Topics

Member Avatar for
Member Avatar for TofiLuk

the frame is okay but the text2, textfield has occupy the whole frame. what's wrong with my code? image: [URL="http://img68.imageshack.us/my.php?image=73815503ku1.png"]http://img68.imageshack.us/my.php?image=73815503ku1.png[/URL] here's the code: [code=java] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class JFrameTest extends JFrame implements ActionListener { JButton button; JLabel label1, label2, label3; JTextField text1, text2; Container con = …

Member Avatar for masijade
0
118
Member Avatar for senthil12345

hi, i have a problem while reloading the apllet with SwingWorker. it works fine in first time, if i reload with the same browser means the Applet window is opened but if i clicking the Download Button means it shows an Exception like "illegalThreadStateException" and it wont perform the copying …

0
60
Member Avatar for edensigauke

well, i started generating my code through Textpad, and when i run it, it runs smoothly, but if i am to create the jar file through Netbeans, it becomes a disaster and returns a null error. i cant even figure out where the error is... here is the part of …

Member Avatar for edensigauke
0
142
Member Avatar for sciwizeh

this is confusing, I wrote this a while ago, and it didn't work right, I am almost sure that it is a simple small error somewhere that I am just missing. when i wrote it I didn't think that it would be good to post it here because of the …

Member Avatar for sciwizeh
1
146
Member Avatar for ocreds

I try add this code(below) after "else if(token.equals("*"))" in PostfixEvaluator.java but it doesn't work like exponent. Can you help me to figure it out what is the right code for exponent. [CODE=java] else if(token.equals("^")) { val1 = Integer.parseInt(stack.pop().toString()); val2 = Integer.parseInt(stack.pop().toString()); result = val2 ^ val1; stack.push(new Integer(result)); } [/CODE] …

Member Avatar for peter_budo
0
232
Member Avatar for MxDev

hi guys, how to distribute or relocate the swing components on the holding frame when window maximize button is pressed????

Member Avatar for bops
0
64
Member Avatar for shelly2373

I have a program i have been working on for my Java class and it is due by the end of this week. My problem is a few things...(1) I do not know how to set the actions on the buttons Save, Delete, Modify and Add. Also I was able …

Member Avatar for deush
0
449
Member Avatar for Natique

Hi :) I was messing around with java applets just now, and I can't seem to figure out how to put more than one event handler in an applet. I'm just working on a really simple calculator. Three buttons, one to add, one to subtract and one to clear everything. …

Member Avatar for Natique
0
188
Member Avatar for Falkoner1

Okay, I have many questions, mainly about subjects that haven't been discussed well in my school class, although I also have a few questions pertaining to a RPG I've been working on. 1. Threads. I've tried to search for a good tutorial on their basics, but I can't seem to …

Member Avatar for Falkoner1
0
153
Member Avatar for VernonDozier

I want to draw some text on a JFrame (later it'll change to a JPanel), but not have the text necessarily be horizontal. I've found some decent examples online that have worked well, but they've all been 500+ lines long. I'm hoping it can be done in a way that's …

Member Avatar for VernonDozier
0
1K
Member Avatar for HLA91

Hi all I have made this small text editor and it works fine. I would just like you too look over it and give me any tips and things, that would make the code better (more acceptable to you). [code=java] import javax.swing.*; import java.io.*; import java.awt.*; import java.awt.event.*; public class …

Member Avatar for Alex Edwards
0
177
Member Avatar for dianac10

Hi :) Could you tell me if there is any possible way to start IE or Mozilla in Java using Swing/AWT components? I don't want just to load html in jeditorpane, i want to really start ie or mozilla. Thanks.

Member Avatar for peter_budo
0
114
Member Avatar for dianac10
Member Avatar for lordx78

[code=java] /* * IconDisplayer.java is a 1.4 application that requires the following files: * images/rocketship.gif */ import java.awt.AlphaComposite; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.Rectangle; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JFrame; /* * This component displays a single icon one or …

Member Avatar for Ezzaral
0
280
Member Avatar for Dio1080

Im just trying to figure out why I have a array out of bounds that all can somebody help? [code=java] public class Life2 { public static void main(String[] args) throws Exception{ boolean dead; int winsX = 0; int num = 1; int count = 0; int countL; int countD; char …

Member Avatar for Alex Edwards
0
143
Member Avatar for sparis

I would like to ask your opinion[s] about how to approach the problem of generating Swing application UIs at runtime. And, to start: I am writing a Swing client application - not an applet and not a browser-based application. My IDEAL user experience would be to simply display DHTML in …

Member Avatar for sciwizeh
0
124
Member Avatar for lordx78

[code=java] import javax.swing.*; import java.awt.*; public class CreateToolbar{ public static void main(String[] args) { JFrame frame = new JFrame("Create a toolbar Which have three buttons Such as: Cut, Copy, Paste"); JToolBar toolbar = new JToolBar("Toolbar", JToolBar.HORIZONTAL); JButton cutbutton = new JButton(new ImageIcon("cut.gif")); toolbar.add(cutbutton); JButton copybutton = new JButton(new ImageIcon("copy.gif")); toolbar.add(copybutton); …

Member Avatar for lordx78
0
99
Member Avatar for HLA91

Hey all I am making a simple text editor, it is my first project and I have got the text area all set up but i have now tried to add a menu bar which will hold the File>Save,Open,exit etc... I have created the menubar and added one menu item …

Member Avatar for HLA91
0
3K
Member Avatar for twgood

This is due Sunday, and I still do not have all of my errors out of the way to see if it runs correctly. Please help I am down to 16 from 20. Errors: ompiling 1 source file to C:\NetBeansProjects\SCHOOL1\JavaApplication55\build\classes C:\NetBeansProjects\SCHOOL1\JavaApplication55\src\javaapplication55\Inventory6.java:146: ')' expected getProductName(), getProductNumber(), getBaseAmount(), getBasePrice() getProductYear() ); C:\NetBeansProjects\SCHOOL1\JavaApplication55\src\javaapplication55\Inventory6.java:146: …

Member Avatar for peter_budo
0
135
Member Avatar for winbatch

Hi, I have a swing app where I am using (among other things obviously) an editable JComboBox and a jButton. when the JButton is clicked, it does some processing and uses the value in the JComboBox as one of it's inputs. I'm finding that everything is fine when: - The …

Member Avatar for winbatch
0
203
Member Avatar for scunnywhite

[code]/*Imports Java library files*/ import javax.swing.JOptionPane; import java.text.*; /*Filename for programs class*/ class KwikKapers { /*Runs program- method*/ public static void main(String[] args) { KwikKapers optpane = new KwikKapers(); } /*Constructor*/ public KwikKapers() { /*Instruction to begin start menu method*/ Startmenu(); } /*Method for main start menu*/ public void Startmenu() …

Member Avatar for Ezzaral
0
85
Member Avatar for ninaijanai

[CODE]import java.applet.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JOptionPane; import java.net.*; public class User extends Applet implements ActionListener {Label lblUser = new Label("Username:"); Label lblPass = new Label("Password:"); TextField fieldUser = new TextField("",10); TextField fieldPass = new TextField("",10); Button btnOk = new Button("OK"); URL order; public void init() {add(lblUser); …

0
55
Member Avatar for twgood

So far it looks pretty good, except in the GUI I can not get the Modify, Save, Delete, Add and Search buttons to work. They produce error codes : Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javaapplication54.ModifyButtonHandler.actionPerformed(Inventory6.java:488) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6041) at javax.swing.JComponent.processMouseEvent(JComponent.java:3265) …

Member Avatar for darkagn
0
100
Member Avatar for oali

hi everyone i really need help with my problem, i have created a full online tutorial using applets however one of my html pages containing this particular applet will not show the applet when viewed in any broswer. The applet contains an image and without the image the browser shows …

Member Avatar for madhavipoudala
0
100
Member Avatar for ocreds

I'm new in java programming but somehow I understand little especially basic because I have a background in Vb6 I find it difficult because it has lot of java keyword that I dont understand. Now, I need your help to defend this program in our class. Help me please. If …

Member Avatar for javaAddict
0
219
Member Avatar for HLA91

Hi all I copied the source code for a simple text editor from [URL="http://www.leepoint.net/notes-java/examples/components/editor/nutpad.html"]http://www.leepoint.net/notes-java/examples/components/editor/nutpad.html[/URL] I tried to modify it slightly by adding a help column to the menu bar so you would click Help> then a drop down list would appear with About and you click that and a frame …

Member Avatar for HLA91
0
164
Member Avatar for HLA91

Hi all In the book im learning from 'Getting Started In Java' one of the example programs is a small swing application with some buttons and icons on the buttons. I typed the code and the book tells me to place my picture that i want to use as an …

Member Avatar for HLA91
0
120
Member Avatar for sTyleSHA

Dear Viewers, I need your suggestion in choosing my job profile further. Currently i work as web designer with 2+ years of experience. I am in the process of learning xhtml, css and keen to explore the technical part of designing. I feel i could learn php also, as i …

Member Avatar for khipucoder
0
156
Member Avatar for Alex Edwards

I'm having a Focus issue when running a Swing application. There are 4 buttons visible on the JApplet. I have an implementation that allows the user to make keyboard and mouse events in the JApplet. The problem is that I can use the keyboard and mouse events when the program …

Member Avatar for Alex Edwards
0
167
Member Avatar for neknek

I compiled the code just fine. But It doesn't show on the webpage. The error message is: load: class C:\kenken\Xample1.class not found. java.lang.ClassNotFoundException: C:.kenken.Xample1.class at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown …

Member Avatar for neknek
0
119
Member Avatar for darlineth

[CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class ExpressionCalculator implements KeyListener { private JFrame frame; private JLabel label; private JPanel boxLayout,panel0,panel1,panel2,panel3; private JTextField TxtInfix,TxtPostfix,TxtPrefix,TxtResult; private Font font; public ExpressionCalculator() { boxLayout = new JPanel(); font = new Font("Serif",Font.BOLD,12); //For infix notation panel0 = new JPanel(new FlowLayout(FlowLayout.CENTER,5,0)); panel0.add(label = new …

Member Avatar for sciwizeh
0
189
Member Avatar for esy928

Good day! hello! lately i've been working on a project of mine and im almost done. but right now i have a problem. in my hangman program i cant seem to make thing that hangs the hangman appear, it will only appera after ive clicked the check button. can anyone …

Member Avatar for kimslov
0
155
Member Avatar for t_3010503

hi all I'm dean. newbie bout Java, i mean i got too basic knowledge about it. I want to learn it because i wan to create a Morse code converter which it will automatically convert alphanumerical words to Morse code. i had read something about java swing. the question is …

Member Avatar for sciwizeh
0
113
Member Avatar for Chris Ichikawa

Hello, everyone. I've been working on an application that will be able to accept customers and bills of an electrical service company. While testing this application, I've come across an error message saying Null Pointer Exception. Okay, here are the details. The application is actually an entire GUI project. It …

Member Avatar for Chris Ichikawa
0
172
Member Avatar for VernonDozier

O.K. I wrote my own version of the Addiction Solitaire game using a JFrame and it worked. I want to put it on the web, so I'm converting it to a JApplet. I have 52 PNG files, one for each card, that I need to be able to access for …

Member Avatar for VernonDozier
0
228
Member Avatar for sciwizeh

ok, so i've been working on this project for a long time now, a falling sand game, on and off. it works [I]almost[/I] the way i want it too... 2 problems, one i don't think this community will be able to help me with, the other, the optimization, i have …

Member Avatar for sciwizeh
1
363
Member Avatar for esy928

Good Day! I'm working on my homework for the past 5 hrs now, i really need some help. I need to create a program that will generate a random point on the Panel. the problem is i cant seem to make the point appear on my panel. any help is …

Member Avatar for esy928
0
80
Member Avatar for Motvel

The idea of program is to change the images between them. Images here is stored in Icon Labels. If i click on image(label), i need to memorize this image, and change with the second image. Like a puzzle game. I can to return the last two clicked image, but when …

Member Avatar for Motvel
0
90
Member Avatar for shwetha_cs26

import javax.swing.*; import javax.swing.event.*; import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.border.*; import java.awt.geom.*; class proj extends JFrame implements ChangeListener ,Runnable,ActionListener //main class { // Declarations public int bottom; public Thread t; int padding = 4; JFrame f; JTabbedPane jt ,jt1; JPanel jp,jp1,jp2,jp3,jp4; JButton j,j1,j2; JLabel lab,lab1; JComboBox jcb,jcb1; //public …

Member Avatar for VernonDozier
0
171
Member Avatar for kumarprabu

Hello any one tell me how do i create the program for upload to server. plz any give some idea abt that which commend is ur for uploading file to server in which way can i handle that

Member Avatar for nitinmukesh
0
124
Member Avatar for bloody_ninja

[code=java]package Ninja; import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.net.*; public class NinjaServer implements Runnable { public final static int NULL = 0; public final static int DISCONNECTED = 1; public final static int DISCONNECTING = 2; public final static int BEGIN_CONNECT = 3; public final static int …

Member Avatar for Alex Edwards
0
438
Member Avatar for frankiesides

could somebody insert the necessary code in this so that it works, as i need to get it working very soon. [code]import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JFrame; import java.awt.*; import javax.swing.*; import javax.swing.JOptionPane; import java.awt.event.*; public class AddCust extends Name implements ActionListener{ Name name; Address address; Loan loan; Borrower borrower; …

Member Avatar for Ezzaral
-1
105
Member Avatar for jimbobjoe

Hi all. I have this assignment to show a panel to allow users to dynamically alter FlowLayout manager parameters. It doesnt look that pretty, but functionally it is working for the most part. I have most of it up and running, but I simply cannot get the JComboBox working. I …

Member Avatar for javaAddict
0
90
Member Avatar for HLA91

Hi All I was reading through the swing tutorial at [URL="http://java.sun.com/docs/books/tutorial/uiswing/start/compile.html"]http://java.sun.com/docs/books/tutorial/uiswing/start/compile.html[/URL] and i copied and pasted the provided source code for the HelloWorldSwing.java program. It compiled fine but when i went to run it the following error message was returned [QUOTE]java HelloWorldSwing Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldSwing (wrong name: …

Member Avatar for Ezzaral
0
852
Member Avatar for LevelSix

Write a simple graphics editor that allows users to add a mixture of shapes (ellipses, rectangles, and lines in different colors) to a panel. Supply commands to load and save the picture. Basically it wants a program with a buttons for New, Load, Save, Rectangle, Line, Ellipse, Red, Green, Blue, …

Member Avatar for Ezzaral
0
305
Member Avatar for zyaday

I have a programm that runs an applet. It loads a series of images and paints them. The problem is the programm seems to not to paint the images in the same order..or rather it skips some of the images....what can i do? I tried using the udate(screen) function but …

Member Avatar for Netztonia
0
106
Member Avatar for Moth126

I'm having a problem with my assginment. This is the Java Number Guessing Game. It compiles and runs with no errors but when executed it stops with only one user input. You must hit the "Play Again" button to continue. Here is my code: [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; …

Member Avatar for sciwizeh
0
79
Member Avatar for zyaday

this is a code that i found fromsome website I replaced line 18 by this line below, and put theimage ho.gif in the project folder. Sth is wrong..image is not displayed on the screen? what is the problem?? I jsut wanted to try it using one image only............that's why i …

Member Avatar for darkagn
0
91
Member Avatar for bloody_ninja

[code=java]import java.awt.Color; import java.awt.BorderLayout; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.net.*; class SocketClient extends JFrame implements ActionListener { JLabel text, clicked; JButton button; JPanel panel; JTextField textField; Socket socket = null; PrintWriter out = null; BufferedReader in = null; SocketClient(){ //Begin Constructor text = new JLabel("Text to send over …

Member Avatar for masijade
0
299
Member Avatar for javagreenhorn

Hello, I have done the code for the final part of the Java Inventory Program in my class. This is the requirements for the final code. • Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow …

Member Avatar for javaAddict
0
193

The End.