3,978 Topics

Member Avatar for
Member Avatar for ceyesuma

Hello. I have been reading some stuff on the action command pattern. ever heard of it? More inportantly, Do you understand it? Because I do not. although I would like to ask if the following class could use the command pattern as aposed to 'if" or "switch" statements. I understand …

Member Avatar for ceyesuma
0
120
Member Avatar for Judas543

To code pretty much makes a grid of a check board. However I want to modify it so if I click on any cell of the grid of the checkerboard it will display a red circle. If I click on a cell that already has a circle, it will remove …

Member Avatar for hanvyj
0
138
Member Avatar for muppet

I have a query which generates an xml file from data collected. There are 2 columns in the data (reason, TotTime) but they are joined together into one column using the concat command. Currently the results are ordered by reason, but I want to limit my results to only the …

Member Avatar for muppet
0
143
Member Avatar for morancr

I'm not sure why it's not calculating right. When I enter a negative number, the if else statement or something does not register it's a negative number. There is a before and after, and you can see where it does not register negative numbers. Thanks in advance for your help! …

Member Avatar for morancr
0
164
Member Avatar for mcdonalds

Hi there, I'm having a weird error, When I click on my submit button my eventhandler that should be capturing the data from my JTextField is throwing an error : This is my first week using Java so I'm sorry if this is a newb thing. My Main function simple …

Member Avatar for Taywin
0
95
Member Avatar for Chalandria

Here is the start of my program. I am having a little trouble linking the farToCel/celToFar user defined methods with the final equations in the action statements. The output is whatever the user enters and 0 for "fah" and "cel". Example: displayTF.setText(inputTF.getText() + " Celsius is " + cel + …

Member Avatar for Chalandria
0
165
Member Avatar for nipponsahore

Hey .. Everyone ... I'm now to java .. I'm trying to figure out .. how everything fits together .. well .. i have a project that I'm working on .. .. basically it a type of quiz working on java .. where a user takes a simple MCQ quiz …

Member Avatar for nipponsahore
0
181
Member Avatar for nipponsahore

Thank You .. EveryBody .. for Your Support .. Finally Got my Project Working again .. Now.. Im facing Only 1 Problem .. The JRadioButtons .. Remain selected even when I get to the next Question .. the Previous selection .. remains .. Selected.. any help how i can .. …

0
66
Member Avatar for Buffalo101

I'm using a JTable with a DefaultTableModel. I use the Load Button for populating the JTable. Anyway, the problem I have is with the Delete row button. (defaulttablemodel.removeRow). This is the whole project: [code=java] package proiect1; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import java.io.*; import javax.swing.event.*; import javax.swing.table.TableModel; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; …

Member Avatar for Buffalo101
0
441
Member Avatar for hannon565

When I try to run the file I get this error, amen't sure how to fix it. [CODE]Exception in thread "main" java.lang.IllegalArgumentException: illegal component position at java.awt.Container.addImpl(Container.java:1035) at java.awt.Container.add(Container.java:408) at EmailWindow.CreateContent(EmailWindow.java:65) at EmailWindow.<init>(EmailWindow.java:22) at Lab6a.main(Lab6a.java:10)[/CODE] Heres my code sorry for lack of comments [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public …

Member Avatar for sakshamsak
0
1K
Member Avatar for nope3d

Can anybody help me how to transfer the inputting of my numbers from left to right... Well here is my program.. [code] import java.awt.*; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextField; public class Calculator2 extends JPanel implements …

Member Avatar for Nishkalank
0
201
Member Avatar for etrac1912

I'm trying to see if someone can help me with two issues with my program. It compiles fine without errors, but some of my numbers in my amortization table only gives me one number after the decimal place and others give me two numbers. I was wondering if something in …

Member Avatar for Eric Cute
0
97
Member Avatar for yap_1991

Hi all, I've created a GUI layout for what I am supposed to do. I have 2 combo boxes in the GUI and both serves the same function. The both of them needs to be able to drop-down the list of files from one of my folders. Hence, I just …

Member Avatar for masijade
0
1K
Member Avatar for Buffalo101

Hello, I want to use a JTable for displaying data loaded from a .txt file. The problem is that I don't see any methods for inserting a row. The code NetBeans generates is this: [code=java] jScrollPane1 = new javax.swing.JScrollPane(); tabel = new javax.swing.JTable(); label1 = new javax.swing.JLabel(); jButton1 = new …

Member Avatar for Buffalo101
0
2K
Member Avatar for sciprog1

Hello Members, I have three balls(all JPanels) bouncing in a JFrame. Following are the files: BouncingBalls.java: [CODE]import javax.swing.*; import java.awt.*; class BouncingBalls extends JFrame { public BouncingBalls() { setResizable(false); setSize(400,400); Ball ball1 = new Ball(); Ball ball2 = new Ball(); Ball ball3 = new Ball(); ball1.add(ball2); ball2.add(ball3); getContentPane().add(ball1); setVisible(true); Thread …

Member Avatar for sciprog1
0
2K
Member Avatar for manonfire89

Hey guys i have been told to do this Bank account program as you can see the description below, what i have so far is a program that i can create the bank accounts and delete them within the Frame, what i cant get working is the withdrawing the balance …

Member Avatar for Taywin
0
218
Member Avatar for haxtor21

Hello Daniweb. I am trying to make an application for a ATM machine (class homework). This is the schematic that I followed [url]http://www.screencast.com/users/haxtor21/folders/Jing/media/303e583a-8f90-46f3-8ed1-a35dde2200bb[/url] My issue is that I'm trying to access a text file and search for a account ID. After the account ID i am doing a nextDouble and …

Member Avatar for haxtor21
0
194
Member Avatar for coco24

I have to write a code that displays a 4 x 4 grid of faces. I am stuck and this is wat i have so far: [code] import java.awt.Graphics; import java.util.Scanner; import javax.swing.JApplet; public class Program7 extends JApplet { public void init() { setSize(2000, 2000); } /** * Draw one …

Member Avatar for kramerd
0
145
Member Avatar for Pushpasheela

Here is my code. [CODE]import javax.swing.table.*; import javax.swing.*; import java.util.*; import java.awt.*; import java.awt.event.*; import java.awt.print.*; import java.awt.geom.*; import java.util.Calendar; public class Salary_report extends JFrame implements ActionListener { Vector data; JTable table; JLabel banner; ImageIcon images; Container c; Employee_report f1; JButton print; String s,days,basic,pf,hra,esi,bonus,advance,allowance,loan,incentive,dother,da,eother,gross,ded,net,leave; double ge,td,np,l,l1; public Salary_report(Employee_report f1) { …

Member Avatar for kramerd
0
137
Member Avatar for Andy_Parr

Hi, I'm writing code for a graphical map of a shopping center. Whilst writing the code I realised it would be simpler to be able to draw objects using "names" instead of values. E.g. g.drawRect(Asda); instead of g.drawRect(100,100,40,40);. Is this possible? I have tried writing various classes but I can't …

Member Avatar for JamesCherrill
0
640
Member Avatar for kurmadu

Hello =) I have some problem to set font and color in my program.can you take a look for the moment please?Here is my simple program: [code] import java.awt.event.*; import javax.swing.*; public class showYourLove extends JFrame //inherits from JFrame class { private JPanel panel; //to references a panel private JLabel …

Member Avatar for Eric Cute
0
146
Member Avatar for triumphost

Hey guys I found the following code snippet below... I want to know how to compile this... I am a c++ programmer and something is wrong with my mouse/audio so I thought this may programmatically solve it but I have no clue about anything java and in c++ there is …

Member Avatar for kramerd
0
295
Member Avatar for adams161

I figured out how to make indentation with [code=java] SimpleAttributeSet style = new SimpleAttributeSet();// = doc.addStyle(null, null); StyleConstants.setLeftIndent(style, 12); StyleConstants.setFirstLineIndent(style, -12); [/code] and then use doc.setParagraphAttributes(doc.getLength(), 1, style, false); after the insert into document. now numbers there doc.getLenght(), 1, i've been changing around but always same issue. The problem is …

Member Avatar for adams161
0
193
Member Avatar for qbmike

Hi, I am relatively new to JAVA and especially SQL and I am having trouble with a "cannot find symbol error. I believe it is at this line catch: "catch(SQLExeception e)". Any advise would be greatly appreciated. Thanks, Mike NetBeans code looks like this: [code] import java.sql.*; public class Book …

Member Avatar for qbmike
0
180
Member Avatar for ceyesuma

Hello I am trying to get to a Component On a JInternalFrame. I have a reference to the frame on the frame there is a panel. on the panel there is a JTabbedPane. to add a tab to the JTabbedPane I need to reference the Pane. Is there a way …

Member Avatar for ceyesuma
0
169
Member Avatar for Me12

Hi, I am having a problem in using radio checkbox to change the color of a graph. The main Idea was to add checkboxes to a graph and also add different shapes to the graph code which was given. The code I tried is the following : [code]import java.applet.*; import …

Member Avatar for Me12
0
195
Member Avatar for Rick-KLN

Hi guys, I really need some help with this, I've spent hours looking for a solution. I have 4 classes of which 2 are important right now. 1. The user enters his username in the JTextField userF, if I print that userF.getText() in the class where userF is created I …

Member Avatar for Rick-KLN
0
240
Member Avatar for subrat_p

[code] import java.awt.*; import java.awt.event.*; import java.sql.*; import javax.swing.*; import java.util.*; public class attendance extends JFrame implements ItemListener, ActionListener { static Connection con; static Statement stmt; static ResultSet rs; static ResultSetMetaData rsMeta; String query; String ref="",rollno=""; String[] heads; int[] stChange; String[][] cubeData; int rows, cols, coo; public attendance(String tit, String …

Member Avatar for subrat_p
0
215
Member Avatar for juniper2009

Dear All I am a newbie Java Learner.I try to learn over Java API Docs.But still I need some help. I have a gui which consist of four textfields(tf1,tf2,tf3,tf4) and a button(b1). If I press the button(b1)"Register", I want my action write whole textfield sources into a text.txt file by …

Member Avatar for JamesCherrill
0
114
Member Avatar for dreamslct

I wrote a simple HelloWorld programe looks like something this: import javax.swing.JOptionPane; public class HelloWorld { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Welcome"); } } ----------------------------------------------------------- In this simple java programe which in not an applet I just want to print the "Welcome" message in some other fonts …

Member Avatar for Taywin
0
200
Member Avatar for dreamslct

I have wrote a simple java programe whose code is as fallow: [code] import javax.swing.JOptionPane; public class HelloWorld { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Welcome"); } } [/code] ------------------------------------------------------ Now I just want that the message "Welcome" to print in differnet size and color. Please help me …

Member Avatar for JamesCherrill
0
202
Member Avatar for aishittero

[B][COLOR="Red"]guys help me if these code is correct [/COLOR][/B] [CODE=java]import javax.swing.*; import java.awt.event.*; public class SampleCalc extends JFrame implements ActionListener{ JTextField txtNum1 = new JTextField(); JTextField txtNum2 = new JTextField(); JButton btnAdd = new JButton("+"); JButton btnSub = new JButton("-"); JButton btnMul = new JButton("*"); JButton btnDiv = new JButton("/"); …

Member Avatar for Taywin
0
84
Member Avatar for xterradaniel

Just a heads up, I posted this same question on Dream in code over 2 hours ago and nobody has answered. The link is [URL="http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044"]http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044[/URL] I have been trying to figure out how to increment or decrement a value if two keys are pressed at the same time (ctrl+, ctrl-). …

Member Avatar for Taywin
0
161
Member Avatar for Javagirl2010

Hello, I a student and Java is very new to me. I am trying to multiply 2 numbers together to be displayed in a dialog box but I keep getting the error of "cannot find sysmbol" and I do not know what I am missing in my file to clear …

Member Avatar for javaAddict
0
250
Member Avatar for ceyesuma

Hello. I created a JTabbedPane on a panel and put it on a JInternalFrame of a JDesktop in SetObjects.java. Why can't I get a tabbcount for it after running an AbstractAction? [b]reference JTabbedPane[/b] [code] [/code] [b]reference JTabbedPane[/b] [code] M =(" --> in controlJMenuItems("+e.getActionCommand()+") var: e.getActionCommand() : xxxxxxxx<-- \n"); System.out.println(M); jtp=SetObjects.getCurrentJTabbedPane(); …

Member Avatar for ceyesuma
0
157
Member Avatar for yap_1991

Hi, Im creating a GUI however i'm experiencing some difficulties. I want to have a text field and a button both placed inside a radiobutton. I've tried inputting ONLY the button, but the button is not displayed when i run the codes. Would be good if light could be shed, …

Member Avatar for di2daer
0
181
Member Avatar for Spiderpig085

hi Guys, Just started java and so far not too bad but i tried to sort out packages today and got this error. Stuck on it for hours. I'm not sure if im importing or setting up the pacakages properly but that where I'm hoping you can help... Im dealing …

Member Avatar for Spiderpig085
0
209
Member Avatar for lilsmurf

I am working on this program and can't get my InvalidTestScore exception to work. Please help! [CODE] public class Grades extends Exception { // Begin public class Grades private double[] testScores; /** Constructor @param scoreArray An array of test scores */ public Grades(double[] scoreArray) // Assign the array argument to …

Member Avatar for BestJewSinceJC
0
200
Member Avatar for NewOrder

[CODE]import java.awt.Color; import java.awt.DisplayMode; import java.awt.Font; import javax.swing.JFrame; class GameStation extends JFrame{ public static void main(String [] args){ DisplayMode dm=new DisplayMode(800, 600, 16, DisplayMode.REFRESH_RATE_UNKNOWN); GameStation game=new GameStation(); game.run(dm); } public void run(DisplayMode dm) { setBackground(Color.PINK); setForeground(Color.WHITE); setFont(new Font("Arial", Font.PLAIN, 24)); Ex7 s=new Ex7(); try{ s.setFullScreen(dm, this); try{ Thread.sleep(5000); }catch(Exception ez){} …

Member Avatar for NewOrder
0
340
Member Avatar for LianaN

Hey! I need to add a child node (its name is stored in Object child1) to the specific parent node (Object hierarchy). To do that, I try to find the parent node and then add the child node to it. However, e.printStackTrace() provides the error message (see below). What am …

Member Avatar for LianaN
0
1K
Member Avatar for Blastoise

Write a program that will ask for a password. If the password is entered correctly, a message should be displayed like “You may enter”; otherwise after 10 tries display a count down from 10 to 0 then a message that the hard drive is being wiped out should be displayed. …

Member Avatar for Eric Cute
0
147
Member Avatar for NewOrder

i want to make a java game . where can i start. i am intermediate at my java (i know threads, swing, generics).. do you know any websites or sources of information that provide project ideas and info on how to create games?

Member Avatar for NewOrder
0
136
Member Avatar for LianaN

Hi! My purpose is to fill the JComboBox from the database. The code shown below is working - it fills the JComboBox. However, the problem is that when I click on JComboBox to select some item, the error occurs. As I understand, String is casted to Object, and this is …

Member Avatar for LianaN
0
245
Member Avatar for ASIWYFA

Hey guys, I am having trouble with my java pacman game. What I have currently is the basics. I am reading in my maze from a txt file which is working. I am stumpted on how to replace the W for my walls with my jpeg of a blue wall(imgGhost …

Member Avatar for JamesCherrill
0
583
Member Avatar for LevyDee

Hi guys, as the thread says, im new to java. My department is more in the c++ side of things. My form class... [code] import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.*; import java.awt.event.*; import java.util.ArrayList; import java.util.Vector; public class DogForm extends JFrame { private String _adminLogin = new String("admin"); …

0
67
Member Avatar for kezkez

I am having a hard time figuring out how to use the db object created in the first action event within the second action... how can i make the object visible there? i am trying to say add a record to db object by saying something like ... class Action2 …

Member Avatar for kezkez
0
158
Member Avatar for jems5

With this code segment, I must be able to output text file data with names of persons along with int values after performing calculations. The program isolates the names, int values and float values and should output the percentage of each value as a functions of total... example out is... …

Member Avatar for quuba
0
101
Member Avatar for noneta

i wrote this code to reverce a word but its give me a error donno why:S i hope u can help me :) [CODE]import javax.swing.JOptionPane; public class sentence { private static void reverse (Sentence){ String sentence; sentence s = new sentence(); sentence=("hello"); } /** * @param args */ public static …

Member Avatar for peter_budo
0
105
Member Avatar for caro11

[COLOR="Red"]hey,i'm having trouble with this code...it keeps saying there is an error..can you help me please...thank you in advance[/COLOR] cannot find symbol symbol: constructor CompteBancaire() location: class javaapplication18.compteBancaire this is the class: [CODE] package javaapplication18; import javax.swing.*; import java.util.Scanner; public class CompteBancaire { private String nom,prenom,typecompte,currency; private int numerocompte; private …

Member Avatar for caro11
0
127
Member Avatar for noneta

hi all,, i really don`t know what its wrong in my code ,,, what i want its the user print the sentence and the program count eash sentence and devide it here is my code,,hope u help me :) [code]import javax.swing.*; public class tracing { public static void main(String args[]) …

Member Avatar for Ezzaral
0
130

The End.