3,978 Topics
![]() | |
I've searched the page but i can't find a way to mark my previous post as closed. This is slightly different so i was not sure if i should create a new post or add to my existing one. Not trying to break any rules intentionally. in this post i've … | |
Hi guys, I have a problem with arranging my components in a GridBagLayout. The frame is 600x600. Inside it, there are two pairs of (Label,TextField). They are not where I want them to be. What I would like is to have them all at the top of the frame, one … | |
Hi guys, I have a problem using GridBagLayout. I will paste my code here. You can run it. Sorry for the length :) I tried to comment it as much as possible. So there are three panels in this GUI. One left, one right, one south. The problem is only … | |
I have a project set up using a JLayeredPane with a number of JLabel objects. Some are gray images, and others are images of cards. The cards are drag-able, but I'm trying to make them so they can only be dropped onto the blank spots, if its not one of … | |
I need to write a program that draws the next iteration if a koch snowflake, when a button is clicked. It begins with a equilateral triangle. The program uses an ArrayList, Polygon, and GeneralPath, as I found these imports in the starter code. I think I may also be supposed … | |
[code] import javax.swing.JFrame; public class Demographics { public static void main(String[] args) { JFrame frame= new JFrame("Survey"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(new DemographicsPanel()); frame.pack(); frame.setVisible(true); } } [/code] [code] import java.awt.*; import javax.swing.*; public class DemographicsPanel extends JPanel { public DemographicsPanel() { this.setLayout (new BorderLayout()); //Panel 1 (North) JPanel panel1 = new JPanel(); … | |
is this a bug in nimbus or am i doing something wrong? i make this jframe: [CODE] package nimbus_bug; import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.UIManager; public class Main extends JFrame{ public Main() { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (Exception e) {} this.setLayout(new … | |
Hello I'm trying to get a jTextField to be updated by another class however the validate() and repaint() aren't working. However, it is saying that the text has been changed for my jTextField. Below is the code could anybody explain to me why its not updating the repainting the jTextField … | |
Hi..I basically new wit java. i have a program called Transfer.java..n when i press button caleed "start Transfer" it executes FileServer.java [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.Random; import java.util.*; import java.text.*; import java.rmi.*; class transfer extends JFrame implements ActionListener, Runnable { JButton btntrans,btnexit; ImageIcon bc; … | |
Hello frnds, I am suffering with a problem. Please help me. The problem is when i am displaying a list of items or say component in to view then the list got weird or we can say jumbled(one item above another) comes for a short moment(less than 1 sec). i … | |
Hey, I am trying to make a program that has pictures on the GUI, but am having trouble making the picture show up. Here is the code: [code] import java.awt.*; import java.awt.event.*; import javax.swing.*; /** Quick example showing images (specifically ImageIcons) on JButtons and JLabels @author Sharon Tuttle @version 11-04-08 … | |
in this program i have to use listners, and radio buttons and buttons....right now i am doing the first part of the program where when the user selects the radio button for circle two circles appear on the screen..... [code] import javax.swing.JFrame; public class shapes { public static void main(String[] … | |
I was instructed in class to do the following.... The Programming Example: Calculator in Chapter 12 is designed to do operations on integers. Write a similar program that can be used to do operations on decimal numbers. (Note: If division by zero occurs with values of the int data type, … | |
hey guys, i have a simple code that simply asks the user to input a number a number and than where you press you mouse it draws a circle you can draw as many circles as you have specified in the beginning of the app. well there is also a … | |
hello friend this is the code of my splash screen i want to play a background music when this screen is appears who can i do that i have "hbd.au" file.which i want to play at back ground.I also want to stop the music when it end i.e recursive playback … | |
Hey daniweb! I have a really serious issue in my program right now. I'll explain how this piece works: -The server sends a ping -The client replies with a pong and starts a timer -Server sends pong back and the client checks how long it took to receive the second … | |
Hello guys, i m working on a program that stores details of a book collection. Following are the things that should be there: [CODE]• Write a new class ‘book’ to represent details of special book objects. A book consists of (for example) the title, number of copies, author, (“The Davinci … | |
whats the best way to make gui programs write all code your self or use the gui creator from netbeans? dont you get crappy code from the creator ? | |
hello friends I have a large table which contains the large text data. the table cell shows the value as for example if value is "Hello Friends" it shown in cell as "Hello Fr". which cuts the value so want to display this complete value in rectangle like joptionpane (I … | |
This is the hardest thing I have tried yet. I am not adding ti as part of the main programme I am doing at the moment cus otherwise it would be too hard to debug. So I have created this as a separate file. I am trying to get a … | |
here is the code for displaying the content of the database if a run the file 'java listall' then it will work well but when i try to run the code from the main class with the help of JButton list as if(ae.getSource() == list) { System.out.println("list working"); new listall(); … | |
i have a main java code called home.java which is an interface. when i press button BTNSTART , i want d progm WebCam.java to exxecute. but it's giving me an error saying : [B]ERROR[/B]: home.java:146: cannot find symbol symbol (constructor WebCam()) the code home.java : [CODE] import javax.swing.*; import java.awt.*; … | |
I can not figure out how to add to my array. The invntory class and dvdrate subclass is not to change. So within my InventoryProgram2 I am told to copy a temp array with the addition of an element to the actual array using the add button. This is so … | |
Hi I am using netbeans and mysql. I am trying to run the an inventory system. I have linked the program with mysql. The program is running but when in log in page I input username and password which is preinstalled in mysql and then press submit, its not going … | |
The program which is executing in windows has occurred error in linux. The program is on the jframe which is designed by using swing controllers is executing with error free in windows but when i use to execute the same program in linux an error as [B]GroupLayout [/B]error is occurring. … | |
I need to create a JApplet containing a JLabel and a Jbutton. a JButton should automatically change font typeface, style and size when clicked. I have this coding so far : import javax.swing.*; import java.awt.*; import java.awt.event.*; public class JChangeFont extends JFrame implements ActionListener { JLabel name = new JLabel … | |
I am faced this Problem that I can't print display parent's content. Please help: [CODE] import javax.swing.JOptionPane; public class BinaryTree { private Node root; BinaryTree() { root = null; } //------------------------------------------------------------------ void buildTree() { String n=JOptionPane.showInputDialog("Root Information:\nEnter Name: "); int a=Integer.parseInt(JOptionPane.showInputDialog("Root Information:\nEnter Age of Root:")); String s=JOptionPane.showInputDialog("Root Information:\nAlive or Dead?"); … | |
Hi all, I have a java swing based client server application. The GUI is in swing and I am using glass fish as my server. Is there a way or any software available to create an environment where I can test my application by creating virtual user connections so that … | |
hey everyone, i just started working with java graphical user interface, i found some source codes from the web and trying to play around with them and i am just unable to understand it fully, the code is well commented and easy to understand it is a simple game called … | |
Hi guys, why wont this work. I'm still learning and have no experience with graphics of any kind. Just trying to put the image onto the background. The link directory is right i think. [CODE] import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import javax.swing.*; //inc javax.swing.ImageIcon public class TheArea … | |
PLEASE WHAT'S WRONG WITH THIS CODES, I KEEP GETTING ERROR AT THIS STAGE [CODE]String result = ci.insertDetails(cid, name, dateOfBirth, String.valueOf(cms.getSelectedItem()), address, city, state , zcode, cnum, nod); String day = String.valueOf(d.getSelectedItem()); String month = String.valueOf(m.getSelectedItem()); String year = String.valueOf(y.getSelectedItem()); String ms = String.valueOf(cms.getSelectedItem()); String dob = year + "-" + … | |
When I put these code in my project. It suppose to display error box when no input is enter, but there no dialog box is pop up. What else do I need for this code to work? Here part of the code I want it to work [CODE] if( costKwhrField.getText().length() … | |
Hey everyone, I have no experience with writing programs. This is my first program and I'm sort of "winging it". I have a problem converting from fahrenheit to celsius, I can convert from celsius to fahrenheit fine though. The bolded part is where I'm having troubles. Here is what I've … | |
I have a drag-able JLabel that I'm trying to set that object to be above all other JLabel objects when its dragged. The only method I can find that sets the order is setComponentZOrder(Component,int)' But when I Try to use it, I get a large amount of errors printed to … | |
I am having trouble making use of a MouseMotionListener to make some card images be able to be dragged around the screen. What this program does is show a table of cards in a random order. The user will be able to drag any of the card images and move … | |
Hello everyone! I have a button on my main form that allows me to get the visitInfo Table. The data are displayed inside a JTable. What I would like to know is how do I edit or delete a row from that Jtable by the click of a save button … | |
so im trying to make a game for school that i have to have done by friday at the max my source for the main class is [CODE]//shooter game //main class import javax.swing.*; //frame import java.awt.*; //color import java.util.*; import java.awt.event.*; public class Shooter extends JFrame implements KeyListener{ Image img; … | |
I am experiencing a problem with this CheckBoxJList class (I found it posted somewhere, it is not mine), in which when there are no boxes checked, and then you check a box, you cannot click to uncheck it--you must first check another box. This is an annoying bug and I'm … | |
I am Trying to write a Java Program that animates 4 arcs to make it look like a moving fan. As of now I have the arcs drawn and Im trying to make buttons for my slow, med, fast and off settings Im getting the following errors: DrawArcs.java:6: cannot find … | |
So, yes, this is a homework assignment, but I have been working on it for days and I really need a push in the right direction please. I have a gui with four buttons: first, previous, next and last. The gui comes up fine. I also have 4 windows with … | |
Hello, I build an applet that plays midi files from a server. The problem is when I start playing the file (MidiSystem.getSequencer()).. it gives me this error in the java console and nothing plays: [CODE]SEVERE: null javax.sound.midi.MidiUnavailableException: MIDI OUT transmitter not available at com.sun.media.sound.AbstractMidiDevice.createTransmitter(Unknown Source) at com.sun.media.sound.AbstractMidiDevice.getTransmitter(Unknown Source) at javax.sound.midi.MidiSystem.getSequencer(Unknown … | |
this is my code, can anyone find out why do i get error? i don get error if i change my array column to lower than row. [CODE]import javax.swing.JOptionPane; public class Chern_sales{ public static void main(String[] args){ double[][] sales = new double[6][7]; double[] total = new double[6]; double[] totalPerDay = … | |
The Mortgage Calculator will calculate and displays the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage. The user will be asked to enter to the amount of the mortgage loan, the term in years of the mortgage, … | |
i need this to work in my program Create a Number Operations Super Class Create an Numbers Operations class that contains common attributes and methods of the child classes create a child class of Number Operations super class that specializes the behavior that is appropriate for the type of operation. … | |
Hi all, I have a problem concerning my project which is Persoanlised Agent for hotels. In fact, i am creating an interface using java swing for entering the details so as to be able to search for available hotels in a specific country.. the different search criteria is 1) Price … | |
how to create a submenu in Swing. I am using Netbeans IDE 6.8. Please help me. thanks in advance | |
I would like some help with this program that I wrote for my class project. I have a class Point, class Circle and a main test program. I'm having difficulty with where to put some if else statements to find the quadrant that the points x,y are located. I wrote … | |
I plan to make Java image viewer I just started today and I had hard time with GridBagSizer After long time of pain it turned to be fruitful. Here is what I have so far. I want the following, of which I have failed: 1. Make the components fill the … | |
Run the program and you'll see I am not filling the arrayList but am invoking the toString method. Obviously this is not giving me the desired output. What's wrong? (I did not post the other classes because I don't think my error is there but if anyone needs them let … | |
[code] import javax.swing.*; import java.io.*; import java.io.InputStreamReader; public class Weight2 { public static void main(String[] args)throws IOException { double cost; double tax; cost=Double.parseDouble(JOptionPane.showInputDialog("Enter purchase amount")); double payment; payment=Double.parseDouble(JOptionPane.showInputDialog("Enter amount tendered")); BufferedReader CHANGE=new BufferedReader(new InputStreamReader(System.in)); tax=Double.parseDouble(CHANGE.readLine()); displayTax(getTax(cost,tax)); setPayment(payment); setTax(tax); setCost(cost); displayCost(getCost(cost,tax)); System.exit(0); } public static double getTax(double y, double x) { … |
The End.