3,978 Topics

Member Avatar for
Member Avatar for doha786

hi, i m just wanna open/explore/view inside of any txt or doc file from folder by using JFileChooser... here i made the code, pls tell me what need to add to open the files.. [CODE] import java.io.File; import javax.swing.JFileChooser; public class OpenFile { public static void main(String args[]) { JFileChooser …

Member Avatar for peter_budo
0
117
Member Avatar for Fbody

Since [URL="http://www.daniweb.com/forums/thread251025.html"]this thread[/URL] was solved/closed about 2-weeks ago, I have not received any subscription messages at all. During that time, I should have received about 15. Did the mail server somehow swing from one extreme to the other? Did the server's IP or mail address change since then? Do I …

Member Avatar for Fbody
0
131
Member Avatar for wee_shark

Hi all, I'm new to java applets. This is basically my first bigger applet. It works 100% fine when I run it in the applet viewer. As soon I start it in a web browser it stops working half way through. The code below is a short version of my …

Member Avatar for wee_shark
0
97
Member Avatar for chern4ever

[CODE]import javax.swing.JOptionPane; public class test{ public static void main(String args[]){ String numT = JOptionPane.showInputDialog(null,"Please enter a value."); double num1 = Double.parseDouble(numT); System.out.println("Fahrenheite = "+num1+"\nCelcius = "+convertFtoC( num1 )); } public static double convertFtoC ( double num1 ){ return ((5/9)*(num1-32)); } }[/CODE] why the value return is zero? hrm... can anyone …

Member Avatar for fardoonmuhafiz
0
177
Member Avatar for basketball4567

I need to be able to choose one of the three boxes and have then drag around the screen, i can only get 1 of them, kinda of. I want to be able to drag the red one, or the green. I can kinda get the green to drag but …

0
92
Member Avatar for Loved

[code=Java] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package paint1; import java.awt.event.*; import java.awt.*; import javax.swing.*; import java.awt.image.*; /** * * @author Jeanine */ public class MyPanel extends JPanel { private int startX, startY, endX, endY; public int …

0
38
Member Avatar for AnnaBaker

I am new to Java and have a class assignment that I need help with.. The assignment is to write a program that computes the tax and tip for a restaurant bill. User is to enter the total amount of the bill. Tax is 6.75% of the bill. The tip …

Member Avatar for Ludachrispeed
0
3K
Member Avatar for pucivogel

i am creating a program for hotel management,i want to get the source from JButton and JCheckBox at the same time,how do i do with actionListener? [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class HotelManagementGUI extends JFrame implements ActionListener {static final String[] rommcouplesea={"1","2","3","4","5","6","7","8","9","10"}; static final String[] roomcoupleroad={"1","2","3","4","5","6","7","8","9","10"}; static final …

Member Avatar for AndreiDMS
0
87
Member Avatar for selenask

Hello could someone please help me as my program is generating some weird error" java.lang.IllegalArgumentException: adding a window to a container" Could someone please look at it and tell me what I'm doing wrong. Im trying to add an object of fan to the panel it creates that error. whenever …

Member Avatar for KirkPatrick
0
167
Member Avatar for karthickparthi

[code]import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; …

Member Avatar for JamesCherrill
0
95
Member Avatar for rwildman23

The following lab was originally assigned but skipped over because we were off for MLK day. I would still like to do it but am just not following what I should be doing. Help? In this lab you are going to extend the code you wrote in you first lab. …

Member Avatar for musthafa.aj
0
126
Member Avatar for DavsTaylor

This is probably a stupid mistake but I can't see the issue, it's with the if statement at the bottom: [code=java] /** * Write a description of class Order here. * * @author David Taylor * @version 1.0 */ import javax.swing.*; import java.text.DecimalFormat; public class Client { // instance variables …

Member Avatar for AndreiDMS
0
145
Member Avatar for Janes

Hi, I would need help, pleas. I would like to portray the curve under the specified angles with the repeat and the number of segments. Will you help me please? now I have this: [code] import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Graphics; import java.awt.HeadlessException; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import …

Member Avatar for adams161
0
116
Member Avatar for Shmoil

Forgive me I am still really new to Java. I have this swing application which creates a small JFrame that when clicked, counts down from 2 minutes and stops at zero. I build a GUI in netbeans IDE and I read that in order to place this timer code into …

Member Avatar for Shmoil
0
303
Member Avatar for CurtisEClark

I'm making this code for class but it will only display the number of days as 28 29 or 30. Im new to Java and would really appreciate help. [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package days; …

Member Avatar for AndreiDMS
0
124
Member Avatar for glenlivet

I'm pretty new to java and I've read some documentation on Layout specifically BoxLayout. I'm not hung up on BoxLayout but it seemed to do what I need. Problem is that label (status) is not left aligned and I can't seem to force it to the left. It will move …

Member Avatar for glenlivet
0
96
Member Avatar for Nicky4815

Hi, I'm working on a dissertation based around graph visualization. I need to make a GUI for my program but I am having trouble getting the JPanels to display what is required. My code so far: [code] //Class to create the GUI import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Component; import javax.swing.JFrame; …

Member Avatar for mr.george
0
135
Member Avatar for adam291086

Hello i am new to java and playing around with some scripts. I have three java files [B]Main.java[/B] [CODE]package snake; import javax.swing.*; import java.awt.*; public class Main{ public static void main(String[] args) { new board(); } }[/CODE] [B]board.java[/B] [CODE]package snake; import javax.swing.*; import java.awt.*; public class board extends JPanel { …

Member Avatar for Stefano Mtangoo
0
162
Member Avatar for Memo..~

Hi everyone.. I wrote this program but I could not get the panels as what I arranged them.. also I don't know what's wrong with the scrollbar cuz I couldn't get the concept of it very well.. [CODE]import javax.swing.JFrame; import javax.swing.ImageIcon; import javax.swing.JPanel; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JTextField; import …

0
65
Member Avatar for Aish_V

Is it possible to populate a treeview by reading the nodes of XML? It is for web application. Without using swing is there any other method? If so.. Please share with me.. Thanks in advance Aish

0
61
Member Avatar for Ecliptical210

Hi guys, I'd really appreciate it if someone could look over my code and tell me why my JComboBox isn't working. I've got 3 Classes, 2 for the GUI, one for the standalone which the array is contained in. [CODE]import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JComponent; import javax.swing.SwingUtilities; import …

Member Avatar for javaAddict
0
160
Member Avatar for adam291086

Hello, i am trying to add a keyboard event listener to my Jpanel. But i am having no sucess. This is my [B]board.java[/B] [CODE]package snake; import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.awt.image.ImageObserver; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JComponent; import java.awt.Image; import javax.swing.JPanel; import java.awt.event.ActionEvent; import …

Member Avatar for thomas_naveen
0
1K
Member Avatar for eikal

hi, i'm working on a little project i made for myself, i want to create a menu with 4 choices and i want to use an array cause im struggling to understand how write them, now ive started to do it but i've lost myself in the code and don't …

Member Avatar for Zaad
0
82
Member Avatar for SasseMan

Hi! I'm writing a java app with a swing gui. The problem is the following. I am developing on a mac, where it runs fine. but when I run it on Windows Posready09 (Windows XP), which is the platform the app is intended for, or Windows7, half of the window …

Member Avatar for SasseMan
0
216
Member Avatar for GoldenDrago

I have a project which I have been working on for the past few days and I have recently reached a point where I don't understand what to do. My program must have a main menu with "Add, remove, List Record #, List All, Sort, Exit" functions. I am supposed …

Member Avatar for GoldenDrago
0
173
Member Avatar for JBeginer7891

Hello members! Could someone please give me a hand on this? I have a JTable in my program that display query resuslt when the user search for a patient by entering the surname, the result is supposed to display in JTable in another frame. Here is what I've done [CODE]import …

Member Avatar for JBeginer7891
0
427
Member Avatar for xShankZ

I have just been learning Java this year, and i am to construct a virtual ATM machine. I stumbled across an "incompatible type" error. Here is my entire Syntax Code: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class BankMachine extends JFrame implements ActionListener { JFrame FraWelcome, FraRegis, FraLogin, FraRegised, ErrorRegis, …

Member Avatar for musthafa.aj
0
112
Member Avatar for nader_shadi2010

Hi could any body help me out fixing this code . Because when I compile it I got an error, I've tried to solve it, but unfortunately I could't . Here is the java code : import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; class MyPad extends JFrame implements ActionListener, …

Member Avatar for masijade
0
342
Member Avatar for StarZ

sooo i finally got the new "pop up" frame after a button is clicked. so than after the user clicks the button and new frame pops up i try to add some stuff and buttons to that new frame.. but it doesn't show. it's just a black frame. I don't …

Member Avatar for StarZ
0
3K
Member Avatar for heroes8453

this is my code. I have no clue what could be wrong with it. The error that keeps coming up is: class, interface, or enum expected. The five errors it pointed out are the 'v' in public void actionPerformed at the bottom of the code, the 'g' in the green …

Member Avatar for gunjannigam
0
93
Member Avatar for skwatamkar

how can i insert an image to ms-access database using java swing form and vice versa.

Member Avatar for ChrisPadgham
0
59
Member Avatar for Banderson

Hi, This will show you how to create a login form using swing. Please be aware that this form does not connect to anything. ( eg. A URL or a database) This is just a little advanced example of one of the many things you can do in swing. A …

Member Avatar for masijade
1
2K
Member Avatar for Shmoil

Hello, I have a school assignment to build a 2 minute countdown timer in java. Gunjannigam managed to assist me in creating the functions. My code for secondCount, I have built a function so that I can adjust secondCount to a number and it will change the timer. When secondCount …

Member Avatar for Shmoil
0
230
Member Avatar for musthafa.aj

hello! i need to create JTable which swing string and animated gif image also... how to put animated gif and data(string) in Jtable cell dynamically... can you give any referel link or codes... i tried lot but vain...

Member Avatar for musthafa.aj
0
915
Member Avatar for StarZ

HI there, so my program so far only has buttons... can someone modify my program so when i press a button there will be another popup page, and so on? thanks ! p.s. my program right now only has buttons but the buttons does not do/go anywhere. [code]import javax.swing.*; import …

Member Avatar for gunjannigam
0
316
Member Avatar for JPDobner

Hi, My code compiles and runs but the GUI will not display. I have tinkered with it but cannot get it to come up. Someone said I may be miscalling my GUI in this code, help? Thank you. [CODE]import javax.swing.*; import java.awt.event.*; public class Application_MainRunInv extends JFrame { private JTextArea …

Member Avatar for JamesCherrill
0
120
Member Avatar for fortex

Hello people, I was recently working on some homework for my class, and I have a error on my code. First, I will tell what I need to do. What the program asks for is for a person to give a 3-number digit(N), from 100 to 999. After that, the …

Member Avatar for musthafa.aj
0
148
Member Avatar for StarZ

hi, I was wondering how can i make a new frame after the password is entered(if it's correct). Like if the user enters the correct password than another brower/frame will open. This is the program: [code]import javax.swing.*; import java.awt.event.*; import java.awt.*; public class password { private static String password = …

Member Avatar for Mandana_bgh
0
121
Member Avatar for StarZ

Hi, so I want to make this kind of "webpage" thing with GUI and how can go to another "page" not open another frame when I click on one of the buttons. Like in my program one of the buttons are "Sign In" and when the user clicks it I …

Member Avatar for musthafa.aj
0
240
Member Avatar for shatha14

hi for all,i tried to write the memory game code but i got mistakes,can any body check them for me please? here is my code: [code=java]import java.util.Random; import java.awt.event.*; import java.awt.*; import javax.swing.*; //some things i didn't use in this game,i was just tryin ^^ public class Memorycard2 extends JFrame …

Member Avatar for adams161
-1
181
Member Avatar for selenask

Hey I'm working with Java and cant seem to get my calculater working, Im trying to use my actionListener to make it all work.. Please help:) [code]import java.awt.FlowLayout; import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JTextField; import javax.swing.text.JTextComponent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class …

Member Avatar for adams161
0
144
Member Avatar for Virux

Alright. I am building a chatroom client. It's using a JFrame as the main window. I wanted to add a feature, to when the window is minimized, I can hide all the components and paint the name of the client in large font. I want to do this, so in …

0
55
Member Avatar for dorkwad

I have seen many JavaScript applications of this being done on the internet and would like to create on designed on Java. As I am new to this, I have no clue on what to do. I have a fair idea and so far I have this: package dice_game; import …

Member Avatar for javaAddict
0
109
Member Avatar for nader_shadi2000

Hello again I made a new user name because I couldn't access using the previous one; I don't know why!! Any way this is the java code of the memory game (solitaire) . Actually I compile it and run it, but it didn't work !!!! could anyone pleassse help me …

Member Avatar for darkagn
0
143
Member Avatar for wondergal04

hey i select any image from combobox.. the label should updated to display that image.. i tried this code. I am not getting through., Just see dis.. please help me... reply fast.. its urgent.. [code] import java.awt.*; import java.awt.event.ItemEvent; import javax.swing.*; public class x extends JFrame { JLabel l; ImageIcon …

Member Avatar for JamesCherrill
0
117
Member Avatar for Bobon

Hey, I've been going insane with a question I've been doing all day. Creating an application that prompts a user to enter a date. I have to use arrays to store the number of days in each month i.e 31 for January, 28 for February etc.. I have created a …

Member Avatar for Bobon
1
190
Member Avatar for P00dle

I had a couple of posts on getting this thing to work. I finally got a small test program working, but now this, the actuall program, doesn't. I don't understand the error either(Will include it at the end of this post). Here is my code, with the line throwing an …

Member Avatar for parry_kulk
0
194
Member Avatar for Shmoil

i have a school assignment where I need to create a countdown timer to attach to a scoreboard i made. the code that is attached is a program i found that is a stopwatch and will count up. im looking to get the timer count down from 2 minutes and …

Member Avatar for Shmoil
0
6K
Member Avatar for SCoder1

Hi, I've been working on this project off and on. I am very close to completing in. What it is is a program that calculates temperature from fahrenheit - centigrade - Kelvin. Please feel free to help. Here's my code sorry for the length of it: [CODE]//-- Shaun D. -- …

Member Avatar for thekashyap
0
101
Member Avatar for skwatamkar

how can insert an image to a ms-access database with using a java swing form and vice versa

Member Avatar for musthafa.aj
0
264

The End.