3,978 Topics

Member Avatar for
Member Avatar for alteran

I've created a gui for the day of the week program. The problem that I'm having is adding functionality to this program. I would like this program to allows a user to select a month and day from choice menus, and enter a year in a text field. Whenever the …

Member Avatar for NormR1
0
330
Member Avatar for harsimran05

import java.awt.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.text.MaskFormatter; import java.sql.*; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lRollNo,lName,lAge,lMarks; JTextField tRollNo,tSName,tMarks; JTextField tAge; DefaultTableModel mStud; JTable tStud; JButton bAdd,bNew,bRemove; MyFrame(){ c=getContentPane(); setLayout(null); setTitle("My Frame"); setSize(800,700); setLocation(10,10); lRollNo=new JLabel("Roll no"); …

Member Avatar for peter_budo
0
161
Member Avatar for harsimran05

showing illegal start of expression in defining functions of mouselistener interface import java.awt.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.util.Vector; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.text.MaskFormatter; import java.sql.*; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; class MyFrame extends JFrame implements ActionListener,MouseListener{ Container c; JLabel lRollNo,lName,lAge,lMarks; JTextField tRollNo,tSName,tMarks; JTextField tAge; DefaultTableModel mStud; JTable tStud; JButton …

Member Avatar for JamesCherrill
0
434
Member Avatar for Onlineshade

Which compiler is needed for the following code? [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import javax.mail.*; import javax.mail.internet.*; public class Main extends JApplet implements ActionListener{ JTextField firstNameArea; JTextField lastNameArea; JTextField emailField; JTextField phoneNumber; JCheckBox myselfBox; JCheckBox someoneBox; JTextArea messageArea; public void init (){ setSize (250,300); setLayout (new BorderLayout …

Member Avatar for JamesCherrill
0
192
Member Avatar for miltondollar

import javax.swing.*; public class NestedLoop { public static void main(String args[]) { for(int x=0;x< 5;x++) { for(int y=0;y<=x;y++) { System.out.print("*"); }// end innerloop System.out.println(""); }//end outerloop System.out.println(); }//end main }//end class

Member Avatar for Rameshwar Soni
-1
106
Member Avatar for authi

Methods: public class metod { public static String computation1 { JOptionPane.showMessageDialog(null," Area of a Circle"); String n = JOptionPane.showInputDialog(null,"Enter a Number"); int num = Integer.parseInt(n); int form1 = (3.14 * (num*2)); JOptionPane.showMessageDialog(null,"… is "+form1); } public static String computation2 { JOptionPane.showMessageDialog(null,"… of a Trapezoid"); String h = JOptionPane.showInputDialog(null,"Enter Height"); int …

Member Avatar for JamesCherrill
0
4K
Member Avatar for stevanity

I made this simple program for a 2 player TiCTacToe game. But It doesnt seem to be working properly. I cant understand whats going wrong here! Please help... [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MainFrame extends JFrame { JButton [][] buttons= new JButton[3][3]; JTextField statusBar; GamePanel panel; Integer …

Member Avatar for stevanity
0
111
Member Avatar for jjohnson33

[code]/*jesse johnson Help.java csc 110 August 25, 2004 */ import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Help extends JApplet implements ActionListener { // GUI Buttons JButton ifButton , ifElseButton , switchButton , whileButton , doWhileButton , forButton, clearArea; JTextArea output; JLabel statusBar; public void init() { Container container = …

Member Avatar for JamesCherrill
0
645
Member Avatar for Bobonoinc

I am new to Java and as an exercise I am trying to develop the following: 2 JPanels on a JFrame where 1 of the JPanels can be used for drawing. I started from an example from Daniweb from 2010 but can't seem to get a graphic context because the …

Member Avatar for Bobonoinc
0
1K
Member Avatar for MasterOfNothing

We have a problem similar to [URL="http://forums.techguy.org/all-other-software/947576-solved-java-applets-only-working.html"]this[/URL] Clean boot doesn't help and the unchecking of services doesn't help ether. We have a Java applet that's working correctly on xp but isn't working correctly on win 7. The applet runs and the browser asks you to accept the certifiket but the …

Member Avatar for MasterOfNothing
0
331
Member Avatar for superjj

Hi This is a code for placing a few labels. Now, I have a problem with my grid. I want the 0,0 point in the upper left corner but at the moment it is around the middle. Can someone help me please? [CODE]import javax.swing.*; import java.awt.*; public class test { …

Member Avatar for superjj
0
172
Member Avatar for akasekaihime

hello everyone! I need help....a prof asked for our help to create a simple program for her assignment but i am having a hard time doing it for I am still not an expert in java.....here is the scenario..... [QUOTE]You are about to go to the Super market and would …

Member Avatar for NormR1
0
181
Member Avatar for aldeene

anyone have a link? I want to display data on the GUI that I made using NETBEANS.. I started learning java today, I got error non-static variable jTextField1 cannot be referenced from a static context. [CODE]Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sample", "", ""); Statement stmt = (Statement) con.createStatement(); String select = "SELECT …

Member Avatar for JamesCherrill
0
128
Member Avatar for baby_c

:( Sorry the topic spelled incorrectly.. I can't edit it noe.. sorry for that Friends again need you so badly.. I'm developing my simple GIS application, actually here's what I developed so far.. [CODE] import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; …

Member Avatar for baby_c
0
253
Member Avatar for baby_c

Hello friends.I got some problems with a program I'm developing for a assignment. I want to add a image(background) to my Jframe and add some buttons. I wrote the code. I can load image into the frame but when I create the Jbutton and re-size it to smaller button it's …

Member Avatar for baby_c
0
27K
Member Avatar for D3X

Hey guys,when i go to enter the same account number as i am logged into as well as any other account and click ok the error message displays however it does not stop me from progressing to transfer money to myself. I have had a shot at it however as …

Member Avatar for JamesCherrill
0
111
Member Avatar for MissJava

Hi all, I really need your help on this as I am just learning Java. I do have an error message which says "cannot find symbol on line 23. Many thanks. [CODE] import javax.swing.JOptionPane; public class averageRainfall { public static void main(String[] args) { //declare variables String[] Month = new …

Member Avatar for MissJava
0
231
Member Avatar for sathya88

any operation with text area is not working,,,cant find bug... [CODE]import java.io.*; import javax.swing.JMenu; import java.io.FileWriter; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JSeparator; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JScrollBar; //import javax.swing.JPopupMenu; import java.awt.Container; //import javax.swing.JFlowLayout; import javax.swing.JScrollPane; import java.awt.Color; import java.awt.Font; import java.awt.FlowLayout; import javax.swing.JFileChooser; import javax.swing.JColorChooser; …

Member Avatar for sathya88
0
207
Member Avatar for sealxlion

Hi, can someone help me? I have two Jframes: Frame and MainFrame. My problem is they both show at the same time. If the login is correct MainFrame opens and Frame closes. [CODE]import javax.swing.*; public class Main extends JFrame{ public static void main(String args[]) { //Frame Window /Login Window Frame …

Member Avatar for mKorbel
0
169
Member Avatar for nikolaos

After login (if succeed) a user will see the result of statement "select test_column from table_test " execution. table_test is the only table of database 'test' which i have created in NetBeans 7.0.1. test_column is the only column. class '[B]MySQLTest[/B]' creates the gui for login , connects with the database …

Member Avatar for nikolaos
0
2K
Member Avatar for MissJava

Hi everyone! I need some help in my programme. I have an error message: "error: int cannot be dereferenced" at line 134. Could you help me solve this problem, as I do not know what it means? Many thanks. [CODE]/** * @(#)PrizeCollection.java * * PrizeCollection application * * @author * …

Member Avatar for JamesCherrill
0
7K
Member Avatar for wondering_ed

Problem: solve the following Source of SHORTEST DISTANCE path of A,B,C,D,E,F,G. I already did link the strings of dots of ABCDEFG and made a polygon which is the other objectives, my only problem now is calculating the source of the shortest distance part of A,B,C,D,E,F,G. Am using net beans. Guys …

Member Avatar for raymagosi
0
168
Member Avatar for ecclesiastes3:1

Good Day... the problem is that the Jbutton is not displaying in my Jpanel. can you help me, this will help me a lot, Thanks Here's the code [CODE] import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URL; import javax.swing.JButton; import javax.swing.JOptionPane; public class GameBoard extends JPanel implements ActionListener { JButton …

Member Avatar for ecclesiastes3:1
0
300
Member Avatar for bangor_boy

I have been playing about with some code tonight and trying to add things to it, so i know it wont make sense when talking about cats and dogs, females and males and music, I run this code and the GUI comes up I click add CD and the required …

Member Avatar for NormR1
0
855
Member Avatar for karyal

hi java professionals! i am building a system that require printing reports. i need small tutorial. besides if you gave an advice about how to form a report, that would be nice. thank you!

Member Avatar for Aviras
0
117
Member Avatar for sathya88

am try to create notepad in java... menu item actionlisteners are not working...except exit... what is the problem with my code??? and is there any sequence follow... because am try to use jScrollpane the text area will be blocked??? code is.. [CODE]import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JFrame; import …

Member Avatar for JamesCherrill
0
233
Member Avatar for jimmylee7706

I'm trying to make a simple text game just for fun. Java is a language I want to learn so making a game is a great start. I'm having problem with my if statement however. This is an example of whats happening. This is only a few hours into the …

Member Avatar for jimmylee7706
0
235
Member Avatar for MissJava

Hi there, I am supposed to make a Java programme called prize collection My programme is a follow: [code]import javax.swing.JOptionPane; import java.util.*; import java.lang.*; public class PrizeCollection { public static void main (String[]args) { // Declare variables and arrays which will be used in the programme String[] Name = new …

Member Avatar for MissJava
0
121
Member Avatar for Vongola_Takeshi

Good Day! My professor in object oriented programming wants us to collect a JFrame form to a class.... he told us the code but it did not work...Hope you may help me...and thanks in advance [code]import javax.swing.JOptionPane; public class Firm { //---------------------------------------------------------- // Creates a staff of employees for a …

Member Avatar for Vongola_Takeshi
-1
9K
Member Avatar for jhopwood

Having some issues figuring out how to code my add, modify, search, delete, and save buttons in my program. The buttons need to also adjust the size of the array once I add or delete the an item. Any help would be great. I may be going about this the …

Member Avatar for NormR1
0
329
Member Avatar for xinwei

Hi all, I'm doing a elevator simulation project but i met some issues. First, I wish to align my buttons on the left to the horizontal lines. I tried to setting setMinimumSize, setMaximumSize, setPreferredSize but it didn't help. Second, if I re-size the window, the buttons on the left seems …

Member Avatar for xinwei
1
756
Member Avatar for sathya88

hi, am try to create a simple jar file... i got some error to run that jar file error =" Failed to load Main-Class manifest attribute from bala.jar" my code: [CODE]import javax.swing.JOptionPane; public class hello{ public static void main(String args[]){ String s= JOptionPane.showInputDialog("enter name plz...."); JOptionPane.showMessageDialog(null,"hello "+s); } }[/CODE] here …

Member Avatar for sathya88
0
159
Member Avatar for zaxahmed

I'm trying to draw the rhombus into each grid section of the 3x3 square grid. Both the codes are pasted. I've tried various methods but could not succeed. Any insight on this matter is greatly appreciated. Thank you. [B][U]3x3 square grid[/U][/B] [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class threebythree …

Member Avatar for NormR1
0
168
Member Avatar for abhinavM

I have a set of radio buttons.These radio buttons are associated with some questions for survey.I also have a Submit button.I want that as soon as I click the Submit button, the application should read the status of radio buttons.But I am unable to figure out a way of doing …

0
110
Member Avatar for domifa621

I have been fighting this but I am not winning. So far I have looked up a ODBC JDBC connection string to connect to my simple database to java without any success. Firstly; I replaced 32bit MS Access 2010 with 64x one. Secondly; I installed all available updates sp1 and …

0
90
Member Avatar for akasekaihime

can anyone help me correct and make my payslip work......how can I correct line 303,306 and 309.................. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class payslip3 extends JFrame implements ActionListener { private static int width=600; private static int height=300; private JLabel[] labelJL = new JLabel[18]; private JTextField[] textJT = new …

Member Avatar for hfx642
0
168
Member Avatar for laguardian

Hey guys! I need help... I have a text field and table that I made on NetBeans. I'm working on GUI. Anyway, in this text field, the user inputs his/her name. And the user's name is displayed on the "User 1" heading of the table: [code] jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object …

Member Avatar for laguardian
0
2K
Member Avatar for D3X

Hi guys, what im trying to do is have a transfer function so that say for example i can transfer $100 from Johns account to Jacks account. Below is the code for the AtmDataFile Class and the ATMTransfer class.I would greatly appreciate some help on this project =). [CODE]import java.io.*; …

Member Avatar for D3X
0
4K
Member Avatar for Majestics

I HAVE TRYING SPLASH SCREEN IN MY APP, BUT CANT GET THE BASICS YET.. SPLSAH SCREEN ISNT WORKING, CAN ANYONE GIVE ME A SIMPLE EXAMPLE hERE is my code. [CODE] import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit; import javax.swing.JWindow; public class introduction extends JWindow { private Image img; introduction() { setSize(128,128); …

Member Avatar for Majestics
0
184
Member Avatar for jhopwood

The Java code I am writing is required to have the first, next, previous, and last buttons, and my program still needs to sort. I believe there is something wrong in my codes for each button. I currently have this (of course with each "" for each button. Any ideas …

Member Avatar for Majestics
0
7K
Member Avatar for jhopwood

I am having some issues with my Inventory Program and could use some help. I had the program working last night where my GUI would display the correct categories but today when I tried to get the restocking fee to add in to the value, I seemed to have messed …

Member Avatar for NormR1
0
676
Member Avatar for Xrrak

I am over my head in my current class and could use help or pointers changing the program I have written. It is a mortgage calculator and I have to modify it. My class texts seem over my head and I have to drive 20 minutes and use public internet …

Member Avatar for quuba
0
124
Member Avatar for PROgamer

Hi, i do have problem with event handling im done with layouting but the only thing i dont know is what methods of event handling should i use in my program [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.border.*; import javax.swing.ButtonGroup; public class Pizza extends Frame implements ActionListener,ItemListener { JFrame …

Member Avatar for hfx642
0
175
Member Avatar for sirlink99

I am trying to save an image with this line [CODE]ImageIO.write(image, "JPG", new File(fileDestination.getText()));[/CODE] but it is giving me an error. [CODE] java.io.FileNotFoundException: C:\Users\Adam (Access is denied) at java.io.RandomAccessFile.open(Native Method) at java.io.RandomAccessFile.<init>(Unknown Source) at javax.imageio.stream.FileImageOutputStream.<init>(Unknown Source) at com.sun.imageio.spi.FileImageOutputStreamSpi.createOutputStreamInstance(Unknown Source) at javax.imageio.ImageIO.createImageOutputStream(Unknown Source) at javax.imageio.ImageIO.write(Unknown Source) at screenCapture.CaptureScreen.actionPerformed(CaptureScreen.java:111) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) …

Member Avatar for NormR1
0
319
Member Avatar for sirlink99

I have made this screenshot program in hopes of eventually making a screen recorder, but I am having trouble displaying the image for the user to see. I currently have it so that it displays and saves. When it displays it is blank, but when it saves there is a …

Member Avatar for mKorbel
0
197
Member Avatar for J-Dub

I used one action listener for an array of buttons that do different things. Exploring methods. I am fairly new to java. I just made a tic tac toe program. I am hoping for people to look it over and tell me what they think, ways to make it better, …

Member Avatar for peter_budo
0
437
Member Avatar for andersonelnino

1)DEFINITION OF DATA REQUIREMENTS Produce an itemised consigment note for each customer including -dimension,weight and price per parcel. -total weight and price consigment -number of parcels RESIDENT DATA -up to 2kg-£7.50 -up to 4kg-£8.00 -up to 10kg-£8.55 -up to 12kg-£9.10 -up to 14kg-£9.70 -up to 16kg-£10.35 -for each extra 2kg,up …

Member Avatar for NormR1
0
215
Member Avatar for J-Dub

I need to know how I can set up a action listener for an array of buttons. I am trying to make a tic tac toe game. I am new to programming. I have seen someone on here ask a similar question but I could not grasp what they where …

Member Avatar for mKorbel
0
4K
Member Avatar for akasekaihime

I have created my own payslip but then when I compiled it, they said that there are no more errors but I cannot view my output on the applet viewer............ is there something wrong with my code or is the viewer at fault here?? here is my code............ [CODE]import javax.swing.*; …

Member Avatar for akasekaihime
0
321
Member Avatar for gunjannigam

I want to have two textfields which will have the following validations 1) Both should be Integers 2) The value in one textfield should be a integer multiple of other I have used two JFormattedTextFields to this. This is what i have done till now [CODE] NumberFormat updateFormat,sampleFormat; updateFormat = …

Member Avatar for mKorbel
0
276

The End.