Sierpinski Triangle

The kth Sierpinski triangle is a triangle whose interior is sub-divided as follows: Take the three mid-points of the sides of the triangle. These points form the vertices of an inscribed triangle, which is colored black. The remaining 3 inscribed tri

How to make a JPanel display on another JPanel when moved?

I have created a card game which allows the users to move the cards, which are JPanels, on top of each other. However, I noticed that if I attempt to move a card to another cards exact location (ie on top of it), that card will not always be displaye

Java frame issues

I am developing Tetris for fun/to learn more about Java. I am having problems with the JFrame aspect of it. I have the actual game portion, which is a on the left side of the screen with the score, level, and high score to the right of this. Then, un

GUI does not update dynamically

im currently trying to create a program that dynamically changes the text on JTextArea's and JButtons when they are pressed, or display a JOptionPane. At the moment nothing is happening when i press the buttons, they are not getting updated nor are t

JButton in JTable Icon / Animation changing when in a hurry

I don't really know how to explain this in words. So I have a JTable with a JButton Column. I have set an icon for this button but when I press or hold the button, it changes into the image you see below. How can I disable this effect? I have tried t

Problems with Layout for the GUI

I am trying to make a simple GUI that has the username and password with the textfields under each one. Any help would be greatly appreciated! Here is my code. I cannot figure out how to get everything in it's rightful place. enter code here import j

Collect all uncaught exceptions in a large application

I have server-client application which has a several users. My client is a big application and there is a lot of exception handlings inside of it. I want to collect and transfer all uncaught exceptions whichs are unhandling. For example, when a clien

Layout issue of the Java GUI

I have the code working for this assignment, but can't figure out how to get it to look properly. I am a bit baffled. Need to use a Border Layout with all five regions added to the container. Just need to be pointed in the right direction...thanks. I

Resize the image to exactly match Jlabel by 300 by 300px

I am retrieving an image from database that is needed to be fitted inside the JLabel of size 300 by 300. In this code the image is not resized instead a part of it is displayed inside the JLabel: ResultSet r; r = s.executeQuery("select * from employe

Memory leaks when JDialog closes

I work on a Java application consisting (as yet) of a regular Window (JFrame) and a JDialog called by a menuitem in the first: public class MainWindow { private JFrame frame; public MyDialog dialog; /* ... */ private void initialize() { mnNew = new J

Develop an image editor in Java

I'm attempting to develop an image editor in Java. Part of my Java image implementation of the image editor is to load an image and draw some shapes in addition to performing rotation, scaling, etc. I'm using JLabel to load images but is there a way

superimpose images in Java

I hope you can give me some advices to solve my problem. I need to overlay many images on a button.but the problem is, this is the base image (tooth): (http://i.imgur.com/7tIcP.gif) my first image is this: http://i.imgur.com/FYuD8.gif and then I put

persist data from a dialog box in Java

if(e.getActionCommand().equals("save to file")) { System.out.println("save is pressed"); StringBuffer fileContent = new StringBuffer(); TableModel tModel = m_table.getModel(); for (int i = 1; i < tModel.getRowCount(); i++) { for(int

getCursor () does not work in my actionListener

So I am just putting the last details of my assignment in and I noticed the getCursor(); works when I run my program, but later in the program (in the two actionListeners) it doesn't teturn to the fahrenheitTB. I was wondering if I could get some inp

Image drawing works for JFrame, but not JPanel

I'm working through some simple applications to get familiar with Swing and running into problems. I'm attempting to have a frame containing an image (in a panel) along with buttons to zoom in/out from the image. I have been able to make a frame with

Pretty friendly graphic library

I'm figuring out which technology to use for my next project, and for now what's going to determine it will be mostly the GUI library. It's best if it has bindings for C# and Java. It's going to be for a game level designer, and it would be great if

checkbox does not work / not editable in JTable

This class is to create jtable with 6 columns, the last one containing boolean checkboxes. I specified it in getColumnClass. I can't uncheck/check these boxes, they are uneditable. I'm suspecting that methods setValueAt and getValueAt in class MyTabl

How to make JFrame exist independently without parent?

I am making a small application. From one JFrame, I am calling another JFrame. Now, I want this child JFrame to exist independently even after I've closed the parent JFrame. Is there any way I can do this? Or is this just NOT possible? Please help me

Java Messenger (multithreading and swing)

hey im having problems with java messenger application. i've made a simple gui in netbeans and a server and client class. when i create a new instance of server in gui i start a new thread and start listening in it. the problem occurs when server get

Java ProgressBar with HTTP Upload does not update

I want my jProgressBar to update its value during HTTP File Upload. I'm new to Java and I'm not sure I'm doing the right things, here's my code: private static final String Boundary = "--7d021a37605f0"; public void upload(URL url, File f) throws

Why setVisible does not work?

I have a swing GUI with border layout. in the NORTH I have added some component. My label component which has GIF icon is invisible lblBusy.setVisible(false); later a button make it visible like below. Why it does not show up? btnDownload.addMouseLis

database in jtable

im am try to fetch data from MS Access database into a JTable.When i run this code snippet in console its working fine but when i do it on a button event in netbeans its not showing any thing.I am using following code and my table name is table1. pri

Java character interface

I am making a GUI dictionary program and have an input of letters that need to be highlighted in each words that is display. I was wondering how to do this, it doesn't seem very hard to color my entire JTextArea, but coloring only certain characters

multithreading for java graphics

I have a java application that streams raw data and draws real time plots accordingly. this is handled by calling methods from a class i wrote that uses the Graphics object. i implemented algorithms in an overridden paintComponent method to generate

Menu GUI Help in Java

I can't compile this code because of several errors. Most of the errors are under the initUI() method, which was copied from a tutorial site. How do I fix this? ActionEvent cannot be resolved to a type MenuGUI.java /Misc/src line 35 Java Problem Acti

Java Swing - Understanding the JViewport

I have a JTable with a JScrollPane. There is something i do not understand with the scrollPane viewport ... I am now selecting row number 1000 in the table, so many rows above it are not visible on the screen. Now when i check if row 0 is visible in

Swing layout: vertical flow

What LayoutManager should I use to achieve a transposed version of FlowLayout? Essentially, I want a vertical list which occupies multiple columns if it can't fit all of it's components within one column. +------------------------+ | item 1 | | item

to add JMenuBar to a JPanel?

I've got a JMenuBar and a JPanel. I'd like to add the JMenuBar to the JPanel. How would I do so?You can use a BorderLayout for your JPanel and put the JMenuBar into the NORTH area of the panel with JPanel p = new JPanel(); p.setLayout(new BorderLayou