3,978 Topics

Member Avatar for
Member Avatar for Mikesvb

Hi there.This is my first post here.I need help urgently. I getting desperate because I got a deadline for a project in 3 weeks time.I'm trying to do a 2 X 2 matrix multiplication applet that simulate systolic architecture.Should be something like the Wallace Tree Simulation. It can be seen …

Member Avatar for jbennet
0
118
Member Avatar for karinmorena

I have been trying to work on this calculator for a while and I need help. I'm getting "12" errors. I'm very new at this and I really need the help of someone that can please take the time to explain what I'm doing wrong. I would really appreciated. [CODE]/* …

Member Avatar for karinmorena
0
332
Member Avatar for Javaman31

just in case someone does not know what mode is it is the number that appears most in a set of numbers The output of the following program is messed up( not just the mode but other parts of it too). It compiles but the output is not right. Her …

Member Avatar for stultuske
0
94
Member Avatar for delosoa

Can you help me with this?? The total will be displayed only when the user type [U][B]-1[/B][/U]. And it will continue looping if you will not type [U][B]-1[/B][/U]. And it will also continue to add the total(that will be displayed only if you type[U][B] -1[/B][/U]). [code=c++] import javax.swing.JOptionPane; import java.text.DecimalFormat; …

Member Avatar for david.crawford
0
142
Member Avatar for delosoa

Can you help me with this?? The total will be displayed only when the user type -1. And it will continue looping if you will not type -1. And it will also continue to add the total(that will be displayed only if you type -1). import javax.swing.JOptionPane; import java.text.DecimalFormat; public …

Member Avatar for javaAddict
0
110
Member Avatar for kpp003

[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Scanner; public class ExpressionCalculatorPanel extends JPanel { // Variables to be used private JLabel inputLabel, resultLabel; private JTextField ExpressionCalculator; private JButton computeButton; //----------------------------------------------------------------- // Constructor: Sets up the main GUI components. //----------------------------------------------------------------- public ExpressionCalculatorPanel() { inputLabel = new JLabel ("Enter a value of …

Member Avatar for VernonDozier
0
85
Member Avatar for JoePie

If anyone can throw a good suggestion my way, i 'd love it. I'm coding a piano that uses Swing and the piano keys are JButtons. A standard computer keyboard can be used to play notes by linking up to the JButtons. I'm only using two buttons for a prototype. …

Member Avatar for JoePie
0
1K
Member Avatar for new_2_java

Hi all, I have a program which bulk-downloads files from a remote server. The program runs in console (I am not using SWING or AWT). I would like to show progres (e.g. progress bar) while the files are being downloaded. Can someone point me to right direction... which classes to …

Member Avatar for Ezzaral
0
265
Member Avatar for ndrux

import javax.swing.JOptionPane; public class cafe2 { public static void main(String args[]) { String name,ch; double price = 0.00; double sum=0.00; int cho=0; name=JOptionPane.showInputDialog("Enter Customer Name:"); do{ ch=JOptionPane.showInputDialog( " Food Name "+ "\n-----------------------------------------------------"+ "\n1) French Fries $ 3.50"+ "\n2) Fish and Chips $ 5.50"+ "\n3) Goat Cheese Pizza $20.70"+ "\n4) Chicken …

Member Avatar for ndrux
0
141
Member Avatar for rockmania

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Calculator { public static void main (String [] args) { JFrame frame = new CalculatorFrame (); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.show (); } } class CalculatorFrame extends JFrame { JTextField jtf; JLabel jlb; JTextField jtf1; JLabel jlb1; JTextField jtf2; JLabel jlb2; JButton jbt; JButton …

Member Avatar for jwenting
0
179
Member Avatar for Derice

I am have no idea wat is wrong with my code. The system is supposed to get 3 inputs from users and display a message box to show the number in ascending order. If i were to get input from input box and display it in message box it will …

Member Avatar for Derice
0
201
Member Avatar for fatjoy25

import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.awt.Graphics; import java.lang.Math; import java.applet.Applet; import javax.swing.event.*; import javax.swing.event.*; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Maint extends JApplet implements Runnable,ActionListener,MouseListener,MouseMotionLi stener { /* Declaring the variables.*/ JPanel panel; JPanel textAreaPanel; Point dot[] = new Point[1000]; Point start, end; int dots = …

Member Avatar for Ezzaral
0
99
Member Avatar for King_Walnut

I'm making a vending machine .. and everything's pretty much together, I just have a few problems that I don't have the faintest clue how to fix Firstly, when I choose a snack, the price of the thing comes up fine, no bother. But if I start to pay, then …

Member Avatar for Ezzaral
0
135
Member Avatar for fatjoy25

import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.event.*; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class MyPaint extends JApplet implements Runnable { /* Declaring the variables.*/ JPanel panel; JPanel textAreaPanel; JTextArea drawTextArea; JScrollPane drawScrollPane; JLabel line, color, paint,kid,cil; JButton circle, rect, poly, ellipse; JComboBox cbLine, cbFill; GridBagLayout g; …

Member Avatar for jwenting
0
75
Member Avatar for fatjoy25

import java.awt.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; import javax.swing.event.*; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class MyPaint extends JApplet implements Runnable { /* Declaring the variables.*/ JPanel panel; JPanel textAreaPanel; JTextArea drawTextArea; JScrollPane drawScrollPane; JLabel line, color, paint,kid,cil; JButton circle, rect, poly, ellipse; JComboBox cbLine, cbFill; GridBagLayout g; …

0
50
Member Avatar for ehrugo

This applet I'm supposed to write needs to have a class that checks the range from the low number entered to the highest and gets and prints all the prime numbers found, as well as the whole number square roots, as well as the sum of the whole square roots …

0
53
Member Avatar for fatjoy25

import java.awt.*; import java.lang.Math; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.awt.Graphics; import java.applet.Applet; /* <APPLET CODE=draw.class WIDTH=600 HEIGHT=200 > </APPLET> */ public class draw extends JApplet implements ActionListener, MouseListener, MouseMotionListener { Button bDraw,bOval, bRect, bRounded,bHeading; Point dot[] = new Point[1000]; JComboBox cbLine,cbFill; Point start, end; int dots = 0; …

0
71
Member Avatar for Questions???

Hello, I am a student. In my Java class we are learning about classes and objects this week. To me this has been very difficult. I have written the following bit of code for the program but I cannot get it to run. The piece of the program is designed …

Member Avatar for ~s.o.s~
0
99
Member Avatar for fatjoy25

import java.awt.*; import javax.swing.*; import java.awt.Color; import java.awt.event.*; import javax.swing.event.*; import java.io.File; import java.util.*; /* <Applet Code="MyPaint.class" width=400 height=400> </Applet> */ public class MyPaint extends JApplet { /* Declaring the variables.*/ JPanel panel; JPanel textAreaPanel; JTextArea drawTextArea; JScrollPane drawScrollPane; JLabel line, color, paint,kid,cil; JButton circle, rect, poly, ellipse; JComboBox cbLine, …

Member Avatar for Ezzaral
0
156
Member Avatar for Rasjoe

import javax.swing.*; import java.awt.*; public class ImageObsApplet extends JApplet implements Runnable { DrawingPanel fDrawingPanel; Image fImg; int fImageNum=0; String fMessage="Loading.."; boolean fDoneLoadingImage=false; public void init() { Container content_pane=getContentPane(); fDrawingPanel=new DrawingPanel(this); content_pane.add(fDrawingPanel); fImg=getImage(getCodeBase(),"Sunset.jpg"); } public void start() { Thread thread=new Thread(this); thread.start(); } public void run() { int width=fImg.getWidth(this); if(width>=0) { …

Member Avatar for Rasjoe
0
118
Member Avatar for dmotah

[code] /********************************* * Program Name: Task2.java * * Date: 27 Janauary 2008 * * Programmer: Dhanandjay MOTAH * *********************************/ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.awt.Graphics.*; import java.applet.Applet; public class Task1 extends JApplet implements ActionListener { JLabel lab1; //label created JComboBox comb1; //combo box created JButton but1; //button created …

Member Avatar for jwenting
0
154
Member Avatar for olliedefig

one of the best games ever was Swing a software 2000 game which company went bust. Worked on win 98 on xp the screen miserably divided into 4 and was unplayable the cd is cracked and anybody knows how to get a replacement or the game working would be happy

Member Avatar for jbennet
0
120
Member Avatar for dmotah

hi, im new to java...and the rest like swing and all that stufss. i got a code but i want to change the applet a bit , i mean the way it is diplayed. ken u help. and yes i want wen i click exit button the applets closes and …

Member Avatar for electron33
0
118
Member Avatar for pradeep.singh28

hi friends, I am pursuing mCA final semester and i want to develop a project in JAVA using swing and applet, i have a good knowledge of core java and swing, so i want a good quality project where i can test myshelf,can you please help me in deciding the …

Member Avatar for jwenting
0
187
Member Avatar for saytri

I am doing a quiz where the user can choose from 3 different quizzez. My tutor told me to use binary files to store the questions. I have succesful done this. The answers are stored in an array. My problem is with a for loop that i have done, to …

Member Avatar for peter_budo
0
116
Member Avatar for hemanthjava

I've read plenty of java Swing forums or questions and none of them have the right answers. I am trying to dynamically select a node in a JTree by searching for it using a search panel based on its property. My jtree allows single selection model. (SINGLE_TREE_SELECTION). [CODE]jTree.setExpandsSelectedPaths(true); // jTree.expandPath(treePath); …

Member Avatar for hemanthjava
0
117
Member Avatar for nljavaingineur

Hello developers, Im still practising my programming with coding a calculator after some reading on the basics of Java. Could really use a pointer or two here. I wrote a calculate function(calculateResult). The error message I got says that the function cannot be applied on the 'number2' argument. (on line …

Member Avatar for Ezzaral
0
102
Member Avatar for adaykin

Hey, I am trying to implement a ctrl + x to close my program when the user clicks on the exit menu item or hits ctrl + x, but so far it is unresponsive, here is my code: [CODE=java] package main; import javax.swing.*; import java.awt.*; import java.awt.event.*; import testing.Intro; public …

Member Avatar for darkagn
0
131
Member Avatar for ceyesuma

In this is just one class. can someone tell me to add a new query? [code] /* * SplashView.java */ package splashapp; import org.jdesktop.application.Action; import org.jdesktop.application.ResourceMap; import org.jdesktop.application.SingleFrameApplication; import org.jdesktop.application.FrameView; import org.jdesktop.application.TaskMonitor; import org.jdesktop.application.Task; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import javax.swing.Timer; import javax.swing.Icon; import javax.swing.JDialog; import javax.swing.JFrame; …

Member Avatar for ceyesuma
0
238
Member Avatar for g_loughnan

Hi all, I've been trying to paint an image to a JPanel with no success. Could someone help me figure this out? [code=java] mport javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.File; import java.util.Vector; import java.awt.image.*; public class PhoneInterface1 extends JFrame implements ActionListener { private JPanel imagePan = new JPanel(); private …

Member Avatar for Ezzaral
0
474
Member Avatar for ceyesuma

I have a desktop aplication with internalframes (inner classes) in a class KeyBrowser.java(the desktopPane). I built a form FourComponentJPanel.form(java)?? the keyBrowser.java allows me to click a JMenuItem to create createDataBaseWindow(). I wanted to have the liberty to have another class that hold the JPanel FourComponentJPanel.java(templet if you will) In the …

0
66
Member Avatar for curt22

I'm new to Java and I'm wonder if someone can help me with this. I have a class that's constructor makes a Gui window, and it's main calls this constructor. The problem is the event handling doesn't work because the event handling code can't access the GUI window variables (It …

Member Avatar for parthiban
0
121
Member Avatar for 71monaro

Can some one please guide me on creating a JSpinner that only supplies value on MouseRelease Events. As dont want to send the intended application updates as spinners contents while rapidly changing. (there needs to be a timeSinceRelease accounted for.) but Its what i need to write like the particular …

Member Avatar for Ezzaral
0
796
Member Avatar for RoOose

Hi.... I've wrote a code about arrange the names in descending order. But, I'm not sure it's right or wrong. Can u help me, please? The code is: import javax.swing.JOptionPane; public class Names { public static void main(String[] argus){ int i = 0; int n =10 ; int j; String …

Member Avatar for Ezzaral
0
89
Member Avatar for arik

I have made application using JBuilder 6 (JRE 1.3) Operating system WIN XP (JRE 1.3) When I run application in JBuilder evrything works fine. Now I made executable .JAR file using JBuilder (wizard -> archive builder -> application) When I executed the .JAR file the background color on JButton (javax.swing) …

0
51
Member Avatar for g_loughnan

Hi there, I have this null pointer exception error in my code which I can't fix. I'm just trying to create an interface which can display an image, text and 12 buttons all at once. I've checked out loads of other threads, but I can't see where the Null entry …

Member Avatar for g_loughnan
0
148
Member Avatar for majestic0110

HI all am trying to construct this hybrid of java and mysql. the data comes from a mysql database and I want it to display in the gui. this I have achieved thus far. However I have buttons that sort by surname, first name, ID tag etc....I need event handlers …

Member Avatar for majestic0110
0
225
Member Avatar for degamer106

I'm stuck trying to figure out how to update the text field after I click on the button in the GUI. The number of roaches is supposed to be updated each time I click, but I can't seem to find the right tool for the job in the APIs. RoachPopulation.java …

Member Avatar for javaAddict
0
116
Member Avatar for likeno1

[B]How can I load an image to my code so i can make it as a background or I apply any function on it like rotate and scale only what I need is the function to load a(.jpeg or .bmp) and where to put it in my code[/B] #include "stdafx.h" …

0
63
Member Avatar for Mongooseman

The Java book I'm using ([i]Java Programming[/i] by Joyce Farrel, Thompson Course Technology), when explaining how to add components to an applet, uses the following code: [code=Java]import javax.swing.*; import java.awt.*; public class JHello extends JApplet { Container con = getContentPane(); JLabel greeting = new JLabel("Hello. Who are you?"); public void …

Member Avatar for masijade
0
233
Member Avatar for RoOose

Hi.... I'm a new member . I've a code , but there is a part I didn't undestand it. Can u help me to undestand it? I am writing the part I didn't understand it by red color: [code] import javax.swing.JOptionPane; public class SortingArray { public static void main(String[] argus){ …

Member Avatar for RoOose
0
133
Member Avatar for majestic0110

HI all, been messing around with this game for a while now. last thing I need to do is get the score(bals dodged) to display in the main menu.Now I have had some helpful advice regarding this issue but I have notbeen able to implement it myself. Nevertheless I am …

Member Avatar for majestic0110
0
115
Member Avatar for leroi green

sup ya'll, i've been doing this Triangle class homework for a couple of days and have ended up having to change how i am attacking it like 2wice but anyway. i've hit the last wall i think i can hit. this code is all wrong & i don't even know …

Member Avatar for javaAddict
0
276
Member Avatar for majestic0110

hi all. I was wondering if anybody out there knew how to implement a high score system for this game(saucer). SaucerMenu is a gui class where i want the high scores to appear (up to 5 highest). saucer is the class where the game resides. many thanks in advance. [CODE]/* …

Member Avatar for majestic0110
0
143
Member Avatar for majestic0110

HI all, this app is a simple game where the objective is to avoid incoming balls (adversaries) however at present I can only figure out how to get one ball on screen at a time. What I'd really like is, when a player hits 100 points, a second ball is …

Member Avatar for majestic0110
0
118
Member Avatar for majestic0110

hi all, I am trying to design a game app that uses a swing gui as a main menu. so far I have been a little confused as to how I get my 'start new game' button to actually launch the game. I have googled event handlers and cannot seem …

Member Avatar for majestic0110
0
82
Member Avatar for ceyesuma

Can any one tell my why the images[i] is not affective? [code] /* * TPanel.java * * Created on December 9, 2007, 7:42 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package keycards; /* * TPanel.java * …

Member Avatar for darkagn
0
179
Member Avatar for Acidburn

Hey guys, How do you tell which type of GUI should you use ? I'm making a swing application but everytime I look at a Java example / tutorial they tend to use different ones for each example. Is there a reason? I'm guessing so which leads me to which …

Member Avatar for enes
0
103
Member Avatar for tactfulsaint

I have this code that i used for shoopping and adding to cart. but the problem here is that when i add to cart it'll not display the artist song that i choose and add 'em to cart rather it uses the one from another class. Please how do i …

Member Avatar for tactfulsaint
0
157
Member Avatar for tactfulsaint

please i need some help with this, i want to display the curent date n time at the bottom of this page. when i run it . THANKS. [code=java] import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; import java.util.Calendar; /* <applet code=" The.class" height=20 width=20> </applet> */ public class The …

Member Avatar for tactfulsaint
0
157

The End.