3,978 Topics

Member Avatar for
Member Avatar for rajesh1158

I have a class which extends JFrame and this class is made singleton (private constructor, public static method to create instance if null). But still I get one more frame when already one is open. Can someone help?

Member Avatar for bibiki
0
682
Member Avatar for Viped

Hi, I can't figure how to detect collision between Ellipse2D and Rectangle2D. I have tried intersects and contains methods with and without getBounds and getBounds2D methods but nothing works. Here is some code, ball and bat are overlapped. package net.viped; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.Toolkit; …

Member Avatar for Taywin
0
912
Member Avatar for wiliams.kikert

Hi all, I've got a code here, as the title says it is a sudoku puzzle. It can create only one puzzle which is there hard coded. Now, the problem is how to add another puzzle? Or maybe I can turn this into a random generated puzzle which is hard …

Member Avatar for Taywin
0
314
Member Avatar for ratatat

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Gui; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; /** * * @author K */ public class Genres extends JFrame implements ActionListener { Connection conn = null; private Statement stmt, …

Member Avatar for JamesCherrill
0
185
Member Avatar for HelloMe

Hello everyone... I have just a simple project where i have to draw a picture (Robot) and on a klick on a button, the Robot turns to the left. My problem is, the Robot turns correctly but the new Robot drawing (position showing the Robot from the left side, back …

Member Avatar for HelloMe
0
199
Member Avatar for jemz

Hi can anyone help me on this..I am tying to change the UIManager. UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); This gives me a lot of Exception. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.plaf.synth.SynthLookAndFeel.paintRegion(SynthLookAndFeel.java:364) at javax.swing.plaf.synth.SynthLookAndFeel.update(SynthLookAndFeel.java:328) at javax.swing.plaf.synth.SynthRootPaneUI.update(SynthRootPaneUI.java:120) at javax.swing.JComponent.paintComponent(JComponent.java:778) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221) at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:295) at javax.swing.RepaintManager.paint(RepaintManager.java:1206) at javax.swing.JComponent._paintImmediately(JComponent.java:5169) at javax.swing.JComponent.paintImmediately(JComponent.java:4980) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:770) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728) …

Member Avatar for jemz
0
749
Member Avatar for 2concussions

hello, hello! im probably being really dumb again, but i can't get java to run keyPressed() when i press a key. do i need to initialize the keylistener somewhere? any input is appreciated!(even if it's not help) import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JPanel; import …

Member Avatar for NormR1
0
308
Member Avatar for phoenix_2000

hey people, I've been experimenting with some new (for me) java techniques, like keybindings. i've got a small app, where the bindings work fine, untill i press a JButton with actionListener. the actionListener doesn't do anything at all, but keybindings fail after i press one of them. here's my code …

Member Avatar for phoenix_2000
0
548
Member Avatar for vishu.bhavsar

Hi All, I am developing a Java Swing application where I am using MS Access database. The problem is when I want to move this project to another location or machine or workspace, I need to change the data source properties in "Administrative Tools". Is there any work-around for this …

Member Avatar for Ezzaral
0
175
Member Avatar for phsims

I have been working on Java game development for a few years.Obviously questions are going to be raised during the development period.I have come to notice that simple programming questions do not get answered by simple programming answers which are emphasised in lowering the morale of the questionaire and it …

Member Avatar for JamesCherrill
0
206
Member Avatar for vivekanand.rai.31

i am making a application using java swing drag and drop property how can i add a calender without coding

Member Avatar for softswing
0
151
Member Avatar for XerX

Hello. I want to make a File->Open menu functionality to this program. In JMenuBar I think I create everything correctly but it doesn't display when I run it. How do I display it and make the Open functionality work? package oimg; import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import …

Member Avatar for NormR1
0
607
Member Avatar for Johannady2

This is our longquiz from this morning. don't worry.. I am not cheating off a quiz.. it's already 22:00 o'clock where I am. this quiz was on 8am. I am studying for our final exam tomorrow. we weren't told the right answers.. and I don't have a book right now …

Member Avatar for DrEinstein
0
317
Member Avatar for wilddrummer

Hi all, thanks in advance for the help. I have placed an "X" on the first JButton and what I need it to do is this... Once the user has clicked the button with the "X" it needs to disappear and reappear on a different button. This process needs to …

Member Avatar for NormR1
0
235
Member Avatar for abbelylee

am trying to load a csv file on my application which allows the action listener to call a readfile method and displays the 2d array on the file to the textarea. i am getting a compliation error of such. pls how do i rectify this setText(java.lang.string) in javax.swing.text.jtextcomponent cannot be …

Member Avatar for NormR1
0
109
Member Avatar for vstl

And I want to show the different words in two text files and make them bold, show on the screen. my code compiles when entering a word show the common words in two txt files and underlined them. instead of entering the word, I want to read a txt file, …

Member Avatar for Taywin
0
841
Member Avatar for Johns3

So I have successfully implemented a search feature into my tiny program but when I click the button to sort, it works fine but the images don't display. In the columns called "A" and "B", images are supposed to show up but they don't. http://i46.tinypic.com/2mx3og8.jpg . import java.awt.Color; import java.awt.Component; …

Member Avatar for Johns3
0
239
Member Avatar for hubber92

Hi guys, I'm trying to create an array with the length according to the number of rows in my database. So here is my code. I getting "array out of bound". import java.sql.*; import javax.swing.*; public class prg extends javax.swing.JFrame(){ String nameC = "HDB"; String nameCC = ""; int count=0; …

Member Avatar for hubber92
0
144
Member Avatar for cisumma

I am in the process of learning how I could use a JListDataListener to change JList elements at runtime: I am goggling this right now to collect examples: I would like to see some code on the subject if anyone has some examples -thanks Here is some code to create …

Member Avatar for NormR1
0
217
Member Avatar for serph09

So I have the code below. The whole program just reads from a text file and prints certain characters if it detects specific characters from the text file (in this case I just made it mimics what the text file has). My text file contains this: .........www... bbb..........ww ...bb....ww.... The …

Member Avatar for JamesCherrill
0
614
Member Avatar for rithish

in java we use import javax.swing when we want to use frame and panel we write like this class frame extends jframe but in c++ we use <iostream.h> and <conio.h> where we use cin and cout from these libraray functions but we dont inherit anything .we use normally we dont …

Member Avatar for Taywin
0
151
Member Avatar for Ricky116

Hello, I am trying to make a simple movie-managing application that allows the user to log into a particular username out of a list of usernames in a text file, and simply view information about movies kept in a text file. This is my first project, from which I would …

0
94
Member Avatar for anandcta123

Dear all, I am working on MDI window JDesktopPane and JFrame. I need to play video in fullscreen mode. I know fulscreen exclusive mode, but this is not the one I wanted. I am trying this by using setUndecorated ion JFrame to screen size, but this will leave uncover MAC …

0
48
Member Avatar for lj81

Hi there, I have developed a pool game for a project but am required to do some JUnit testing to finish it off but I have not been shown any in my course and as a result I am totally confused with how to do this. My lecturer won't give …

Member Avatar for SasseMan
0
283
Member Avatar for alfredarthur

I want to add squares onto a jpanel one at a time after a delay . My program works fine until I tried to change the background color with setBackgound(). It didn't change. I worked out I have to call super.paintComponent(gr) in my paintComponent method. But when I do this …

Member Avatar for sciwizeh
0
1K
Member Avatar for singeryoon

1. I have some question regarding inserting two panels from a class to a JFrame from another class, both having same package of GUI. How to do this? 2.And how to make JFrame to display different panels during application run? Example, I have a JButton in class A which after …

Member Avatar for sciwizeh
0
2K
Member Avatar for annette_arpana3

> > Quoted Text Here i am doing a snmp monitoring tool using java.. how can i insert a word rather that inserting the object indentifier value in the text box. it will be more user friendly if users only need to insert the word rather than inserting the long …

Member Avatar for annette_arpana3
0
165
Member Avatar for broodwich

I have to make an applet that gives you 2 single digit integers and you have to multiply and then it will tell you if you are correct. I got it to work but how do I make it continue the same set of numbers until you provide the correct …

Member Avatar for stultuske
0
155
Member Avatar for jab8288

I created the GUI to display the monthly mortgage payment for any loan principle at a specific term and rate. The GUI works fine but I have some improvements I can't seem to figure out and I need to display an amortization table. Issue# 1: I am usure how to …

0
88
Member Avatar for happygeek

Acronis responds to DaniWeb questions regarding a leak of customer data which, [as we exclusively reported over the weekend](http://www.daniweb.com/hardware-and-software/microsoft-windows/viruses-spyware-and-other-nasties/news/427455/breaking-acronis-blames-technical-issue-for-customer-data-leak), resulted in some information being indexed by search engines and accessible to anyone on the Internet. ![dweb-acronis2](/attachments/small/0/dweb-acronis2.jpg "align-right") Although the leak itself was identified by Acronis on Friday 29th June, the …

Member Avatar for CMaker3
2
530
Member Avatar for broodwich

I have the following problem: Write a Java Applet that will help an elementary school student learn multiplication. Use either Random class or Math.random() method to produce two positive one-digit integers. The applet should prompt the user with a question. The student then enters an answer. If the answer is …

Member Avatar for broodwich
0
275
Member Avatar for SakuraAssassin

I am writing a program with java and i am having trouble displaying my .txt in my JTextArea. it shows it as 1 appended line and i want it to display the way it is set out in my text file. Here is my code: import java.awt.*; import java.awt.event.*; import …

Member Avatar for SakuraAssassin
0
127
Member Avatar for nixeria

Hello! I want the java code for login+registration form using swing along with mysql connectivity. i do not want jsp or java script coding. just simple java code. please revert as soon as possible!

0
55
Member Avatar for coroll

Hi, i get an NullPointerException in this line:if (let==currentLink.aLetter) in search method. This is node class public class Letter { char aLetter; int points; Letter next; public Letter(char aLetter,int points) { this.aLetter=aLetter; this.points=points; } public Letter() { } public String printLink() { // System.out.print("{" + aLetter + ", " + …

Member Avatar for JamesCherrill
0
124
Member Avatar for pateldeep454

Main.java [CODE] package scrabble; import javax.swing.JOptionPane; import javax.swing.JDialog; public class Main { public static boolean isDoubloon (String word) { int count[] = LetterHist.letterHist (word); for (int i = 0; i < count.length; i++) if (count[i] == 2 || count[i] == 0) continue; else return false; return true; } public static …

Member Avatar for svfox2000
0
323
Member Avatar for Xufyan

here i've created the first applet but it is not working, [CODE] import java.applet.Applet; import java.awt.*; public class FirstApplet extends Applet { public void paint(Graphics g) { g.drawString("Look at me, I'm a Java Applet!",10,50); } } [/CODE] i am getting no errors but when i am opening the html file …

Member Avatar for _aven
0
241
Member Avatar for branflake

On my class side I cannot seem to get netPay to calculate and am also having problems with finding insDeduct. On the demo side I have you choose between S - Single and M - Married. Any help would be greatly appreciated. [CODE]public class ChapterFiveClass { // Declare some fields …

Member Avatar for SylvesterAbreu
0
140
Member Avatar for jdseader

The following four classes are an attempt to set up three different JFrames and switch between them. The three frames are: MainView, DetailView, and FormView. The main class is MultipleFramesExample. The four source codes constitute a NetBeans project with a package called FrameViews. MainView, DetailView, and FormView are essentially identical …

Member Avatar for JamesCherrill
0
4K
Member Avatar for jab8288

I am trying to format my text firlds so that if the user inputs letters or somethings improper, it will display an error message and ask the user to retry entering the number. i am not quite sure where to start with this part. i have the calculator code working …

Member Avatar for JamesCherrill
0
193
Member Avatar for rahman86

HI all in Daniweb. I have a problem here. I wanted to create a desktop database application using Java DB Embedded. What is the problem here i try creating a frame from scratch and want to connect to the database. I have create a connection to the database. it was …

Member Avatar for bloggernewbie
0
3K
Member Avatar for Jack5848

so basically for my uni work i have to create an applet that gives a word pattern for a particular sentence, ie '1 am a man' would give 2, 1, 1, because there are 2 1 letter words, 1 2 letter word and 1 3 letter word. the harder part …

Member Avatar for JamesCherrill
0
164
Member Avatar for adnan18

/** * @(#)password.java * * * @author * @version 1.00 2012/7/14 */ import javax.swing.JOptionPane; import javax.swing.*; import java.util.*; public class password { public static void main (String[] args) { String user; user=JOptionPane.showInputDialog("enter password to continue(letter only)"); if(user.compareTo("adnan")) { JOptionPane.showMessageDialog(null,"ACCES GRANTED","welcome", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(null,"ACCES DENIED","error", JOptionPane.ERROR_MESSAGE); } } }

Member Avatar for adnan18
0
138
Member Avatar for wallet123

i want to create a program that would translate number to words from 1-1 billion this is how i started: package app.runner; import javax.swing.*; public class EnglishNumberToWords{ public static void main(String args[]){ int inputNumber=0; String oness[]={"one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"}; String tens[]={"ten","twenty","thirty","fourty","fifty","sixty","seventy","eighty","ninety"}; String answer=""; String calculate=""; inputNumber=Integer.parseInt(JOptionPane.showInputDialog(null,"PLease Enter a Number: ")); int billion=inputNumber/1000000; int …

Member Avatar for JamesCherrill
0
249
Member Avatar for annette_arpana3

import java.util.*; import java.net.*; import java.awt.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.plaf.*; import java.awt.event.*; import java.io.*; import snmp.*; public class SNMPInquisitor extends JFrame implements ActionListener, Runnable { JButton getDataButton, getTreewalkDataButton, getTableButton, getNextButton, setValueButton; JButton clearButton; JTextArea messagesArea; JScrollPane messagesScroll; JTextField hostIDField, communityField, OIDField, valueField; JLabel authorLabel, hostIDLabel, communityLabel, OIDLabel, valueLabel; …

Member Avatar for JamesCherrill
0
241
Member Avatar for gedas

Hey guys, I am creating a simple java swing app that would allow me to monitor the activity on my sites. I am using google analytics api to do most of the monitoring(breif descritpion can be found here : https://developers.google.com/analytics/devguides/reporting/core/v2/gdataJava) however this does not show how to incorporate the new …

Member Avatar for gholtean
0
91
Member Avatar for Viped

Hi, I am trying to make simple gui which switches jpanel inside jframe but my IDE says "Cannot make static reference to non static method setPage(int) from the type Main". Why is that? There is no static modifier on actionPerformed or at setPage or actually anywhere else than public static …

Member Avatar for JamesCherrill
0
168
Member Avatar for gosensgo87

**Hello i am a noob when it comes to java so sorry if its obvious but the code below is giving me a error when i try to compile it, the error is: Exception in thread "main" java.lang.Error: Unresolved compilation problem: at goodcalculator.main(goodcalculator.java:127). Can anyone help me? ** CODE: import …

Member Avatar for JamesCherrill
0
312
Member Avatar for 47pirates

I've a bill which looks like ![untitled31](/attachments/large/2/untitled31.JPG "untitled31") this is the paper which i use in printer and i want to print the appropriate value in the correct position of that paper. As in the place of date i want to print date and in the place of Rate, Amount …

Member Avatar for JamesCherrill
0
138
Member Avatar for amin.sohal

Hi, Here I face one problem in java application. I am working on one project, developed in java 1.4 & 1.5 swing, jboss, applet on netbeans 3.6. But I got an error when I try to debuge or execute in netbeans "IO EXCEPTION WHILE READING: Localhost". Project is successfully build. …

Member Avatar for rubberman
0
94
Member Avatar for B204

Following are the server-client programs,,,, in this client can send files and server have to save it,,,,,i want to add progressbar.....plz help me out!!! client:- import java.net.*; import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; class ftpclient extends JFrame implements ActionListener { JButton b1,b2; JTextField t1; ftpclient() { b1 =new …

Member Avatar for JamesCherrill
0
398

The End.