3,978 Topics
![]() | |
[CODE]import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; 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.BufferedReader; import java.io.FileWriter; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.FileReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.io.FileReader; import java.util.*; … | |
Hi, I’m trying to code a small program which allows us to select multiple files from a folder and save the content of all files previously selected in one file. The code is very well without GUI (in console). But now I want to do the same with a GUI. … | |
create a Report of Customers and my database are MicroSoft Access 2000 Coding are Following Plz somebody hlp me in my project [code=java]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class FrmCustomerReport extends JDialog{ public static JTable JTExpTable; //Start create variables JButton JBSearch = new JButton("Print",new ImageIcon("images/print.png")); JLabel JLPic1 = new … | |
the answer to this i found on the web was this: The AWT event dispatcher thread is not a daemon thread. You must explicitly call System.exit to terminate the JVM. and what i understand of it is that the thread which is terminated when we close a JFrame or Applet … | |
Hi guys, I am fairly new to JAVA and currently I am trying to do a couple of pre-set graphs. My first task is to create a graph of y=x^2. The code below is what i have come up till now. I am sure that i need help in the … | |
I am new to java Swing. I am trying to develop a tool, in which I used a Jtextpane as an editor. Jtextpane is enclosed in a Jtabbedpane to meet my requirement. But I have inserted the JTextpane in a Jscrollpane and then to the Jtabbedpane. Now, when I select … | |
![]() | If one thing should be at the forefront of every system administrators mind, then it is security. Microsoft has been taking a lot of flack about not being as secure as they could be, and there has been a market swing in the use of the Firefox web browsers as … |
I cant seem to find the problem with this program I am building as a learning exercise. I am getting errors referenced to extremely simple pieces of code. In the output the first thing that should be printed is the random double number that the program selects then it should … | |
Hello, The following program has a JButton and a JLabel in a JFrame. I am using Flow Layout. How do I get the JLabel to show directly below the JButton before clicking the JButton and after clicking the JButton? Thank you! [CODE]import java.awt.event.*; import javax.swing.*; import java.awt.*; public class checks … | |
/*Here is my code as you can see the in front of rice set the four RadioButton in different Location? i have been tired but i can't solve this problem .Help me Please if u can.*/ import java.awt.*; import java.awt.event.*; import javax.swing.*; class Fnf{ static Box createBox(String[] sa) { Box … | |
Im trying to make an employee database where the user can add, delete, search for, view all, edit an employee, and quit. After the user clicks the add or delete button, the program is supposed to allow them to input the names and other things nd when they press enter … | |
Hi, I am new to Java Swing. I am trying to develop a GUI for my tool, which consist of a JTextPane which is enclosed in a JScrollPane and to meet my requirement I am using a JTabbedPane for holding this textpanes. In the right side of the GUI I … | |
Dear all I need your guidlines with this project because I dodnt done nothin yet an i am terrified to admit that I am going to deliver this on Wednesday and in the midtime I have a final in another course. What I didn till now is the UML for … | |
I have a label,4 radio button.I have retrieved data from sql.I need to display the retrieved question in label and its 4 option in each of radio button.I got it working to display one question.my trouble is in button click.when next button is clicked question should change...any more ideas is … | |
Dear All First of all I wish you a very happy new year. I have been trying to understand the depreciation matters. As you can see in the codes below, There are 3 handleEvent methods used as pressbutton action , radio button selection action and dropdown list selection action. Now … | |
Hi, This is my first forum post and I'm very new to both the daniweb and programming community. I've been working on a project for a month or so and it involves clicking JButton to change the values of the text associated with the JButton clicked. Everything runs fine except … | |
I am new to swing. Now I am developing a frame with multiple tabs. For this I used jTabbedpane. Now the problem is that I am not able to save contents of seleted jTextPane of jTabbedPane. While saving, I am only able to save contents finally wriiten on jTextPane. So … | |
HEllO EVERY ONE I need you help in my java code that I built on netbeans First I will example the idea of the programm GUI are containing two textfeild The first textfeild the user have to enter price The second textfeild the user have to enter weight then when … | |
I'm trying to make family tree webapplet, to test it out outside of the site I just used JFrame. I've used GroupLayout to set up things, but I'd like to have a fixed size, now it just takes up the size of the JFrame. NewClass.Java [CODE=java] /* * NewJPanel.java * … | |
Im using jcombobox in a simple database application . I want add the resultset of a particular query as element in jcombobox. Im using netbeans and i found an option called binding but im confused how to use it!! Please help. | |
hello friend's I have writeen a program for music player here is the code... . [CODE] import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.sound.sampled.*; import javax.swing.event.*; /*<Applet code="kkk" height=400 width=400></Applet>*/ public class kkk extends JComponent { static File f1; int prog; static JFrame jf; int al; JLabel time; … | |
hi everyone, i'm a new member of this forum..i'm trying to retrieve the video stream from my Axis camera..i don't know what's exactly the problem:when i run the project there's no errors but i get no video on my jFrame.. this is my code,can you please help me to know … | |
hi guys, i am using eclispe 3.5 to develop a hangman game but im in no man's land now. I have created 26 alphabets buttons A-Z and i want to display the alphabets in the JTextField when the button is clicked. When the user guesses the word incorrectly the word … | |
I'm trying to make it so when I press ESC, it RestoreScreen() but it doesn't work. Now I don't know whether it's my method RestoreScreen() or my listeners. This is my code: [code]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class main extends JFrame implements MouseListener,KeyListener{ public void keyPressed(KeyEvent e) { … | |
public class Account extends javax.swing.JFrame { /** Creates new form Account */ public Account() { initComponents(); setTitle("Bank Account"); jTextArea1.setEditable(false); } /** * @param args the command line arguments */ private int accountNumber =0; private double balance =0; public Account(int accNum, double bal) { accountNumber = accNum; balance = bal; } … | |
I got that code from [URL="http://www.javafaq.nu/java-bookpage-19-3.html"]here[/URL]. Everything's working except the balls! There is panels, splitpanes etc. Oh Look, no balls! I need to solve it like in an hour. Please help. I say again; please... [CODE]import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.event.*; public class Split … | |
i[CODE]mport javax.swing.*; public class ReverseArray { public static void reverse(int b[]){ int left = 0; int right = b.length -1; while(left<right){ //exchange the left and right elements int temp = b[left]; b[left] = b[right]; b[right] = temp; left++; right--; } } public static void main(String a[]){ } } [/CODE] how … | |
I have a HW. It must be sent to the teacher in 12 hours. Any help would be great. I need to do this using JSplitPane: [URL="http://javafaq.nu/free-swing-book/Chapter8_files/image002.gif"]http://javafaq.nu/free-swing-book/Chapter8_files/image002.gif[/URL] There are moving balls in seperate panels(not imaages). Smaller the panel's area, faster the balls move. I did the JSplitPane and Panels but … | |
I am working on this exercise: Write an application that asks its user to type a complete sentence on one line. The application then displays in the console window the words in the sentence, one word per line, less any punctuation. I have the following code: [CODE] import javax.swing.*; import … | |
Hi, I've decided to make a hangman game. I made this in Python last year, however I'm a little bit stick in Java, since I'm quite new to as well as Swing. Anyway, the problem I'm having is that my while loop keeps terminating if I enter 1 incorrect letter, … | |
[CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class JHelloFrame extends JFrame implements ActionListener{ JLabel question= new JLabel("What is your name"); Font bigFont= new Font("Arial",Font.BOLD,16); JTextField answer= new JTextField(12); JButton pressMe=new JButton("RressMe"); JLabel greeting= new JLabel(""); final int Width=175; final int Height=225; public JHelloFrame() { super("Hello Frame"); setSize(Width,Height); setLayout(new FlowLayout()); question.setFont(bigFont); … | |
My teacher gave me a program which will maintain the attendance of some class daily , i have made it fully , i use eclispe IDE -JAVA SE , there are a lot of swing components in it like textfields,checkboxes,JList etc so there are Listener classes for the components. constructor … | |
trying to work on netbeans on a project.... getting the following error [CODE]Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41) at java.awt.image.Raster.createPackedRaster(Raster.java:458) at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015) at sun.awt.image.SunVolatileImage.getBackupImage(SunVolatileImage.java:225) at sun.awt.image.VolatileSurfaceManager.getBackupSurface(VolatileSurfaceManager.java:252) at sun.awt.image.VolatileSurfaceManager.initialize(VolatileSurfaceManager.java:108) at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:72) at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:82) at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:93) at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:87) at sun.awt.windows.WComponentPeer.createVolatileImage(WComponentPeer.java:604) at java.awt.Component.createVolatileImage(Component.java:3316) at java.awt.Component$BltBufferStrategy.createBackBuffers(Component.java:4038) at java.awt.Component$BltBufferStrategy.<init>(Component.java:3983) at java.awt.Component$BltSubRegionBufferStrategy.<init>(Component.java:4236) … | |
[CODE]package myDxBall; import java.applet.*; import java.awt.*; import java.awt.event.*; import java.awt.Shape; import javax.swing.*; import javax.swing.event.*; /* <applet code="myDxball.class" width=670 height=300> </applet> */ public class myDxBall extends Applet implements Runnable,MouseListener,KeyListener{ static Rectbar Recob[] = new Rectbar[45]; Thread th; int x_pos = 5 ; int y_pos = 50; public static int radius = … | |
[CODE] package myDxBall; import java.applet.*; import java.awt.*; import java.awt.event.*; import java.awt.Shape; import javax.swing.*; import javax.swing.event.*; /* <applet code="myDxball.class" width=670 height=300> </applet> */ public class myDxBall extends Applet implements Runnable,MouseListener,KeyListener{ static Rectbar Recob[] = new Rectbar[45]; Thread th; int x_pos = 5 ; int y_pos = 50; public static int radius … | |
Hi, I've started to learn about threads in java. I'm trying to make this simple animation of a rectangle. Where am I going wrong? I was under the impression that if a class implements Runnable, when it is executed, it looks for the start method, which in turn starts the … | |
I need to port an application i wrote in MS csharp to java. I used the WebBrowser control to deal with complex html and javascript. Whats the simplest solution for java? (im using swing components) | |
Hilan International Bank decided to have a salary plan for its employees. In the new Policy, bonus is based on the fact that one is a senior staff or junior staff. You have been called in as a programmer to develop a software to meet this policy’s requirement: (a.) Create … | |
I need to port an application i wrote in MS csharp to java. I used the WebBrowser control to deal with complex html and javascript. Whats the simplest solution for java? (im using swing components) | |
i really need help... i dont know where the problem... the line error on that part>>`class reserveform extends JFrame implements {` import java.awt.Dimens; import java.awt.*; import javax.swing.*; import java.util.List; import java.util.LinkedList; import java.util.Iterator; import java.util.ListIterator; import java.util.Collections; import java.awt.event.*; class reserveform extends JFrame implements { // operation interface JPanel operation; … | |
Hai friends, Am using java swing, is there any juint test for swing gui application, kindly help me in this problem.Thanks. | |
/*trying to set the textfield to null when i input the numbers but the zero still remains after i start typing.How to i get it to disapear when i start typing */ package Vectors; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.*; import java.util.*; import javax.swing.*; … | |
Hi! I'm trying to add dragging and dropping behaviour to JLabel. It works only when I press the mouse for the first time. If I continue pressing the mouse, the error message shown below is generated. Please, help me to find an error. [CODE] JLabel bkg = new JLabel(icon); jLayeredPane.add(bkg, … | |
Why won't this work? I'm trying to make a ball appear and move along my screen but it's failing :'( . I'm :( and also trying to make it so when you press any key it restores the full screen but that's also failing. :'( Can anyone help? [CODE]import javax.swing.*; … | |
Hi guys, I'm trying to create a 2D array of JLabels my first problem is actually creating them. my code atm is = [CODE] package test; import java.io.File; import javax.swing.JLabel; import javax.swing.JPanel; public class testing extends javax.swing.JFrame { /** Creates new form testing */ public testing() { initComponents(); for(int i … | |
Write a java program that read 2 integers numbers, Then determines and prints if the first is a multiple(double) of the second NOTE : Using if and else statements - and use the modulus ( the percentage mark ) to answer the question this is my answer !! pllz if … | |
Hi there, Every time i am making a program in Java(Advance). I found that it can many errors in it. For example I am Giving u a program written by me //a push button with all features [code] import java.awt.*; import javax.swing.*; import javax.swing.border.*; class Mybuttons1 extends Frame { //vars … | |
the errors are commented in the code: help??? [code]import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; import java.lang.*; public class Kol2_1 extends Applet implements ActionListener { Button plus = new Button("+"); Button minus = new Button("-"); Button times = new Button("*"); Button div = new Button("/"); Button eq = new … | |
Hello all, I'm creating a login application using swing but ive run into problems already, I need help on making the if else statement work so the background is red. Your help is very much appreciated, [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; class MyWindowListener extends WindowAdapter { public void windowClosing(WindowEvent … | |
Good afternoon, I have a problem... Else I wouldn't be posting here, right? My quandary is thus: I have an empty table in a database that I want a user to be able to fill. This will occur when employees are replaced for sick leaves, etc. I'd like to be … |
The End.