3,978 Topics
![]() | |
Good Day All, I have another question: I have done this program to sort a list of artist and their biggest hits, etc. It has 4 parallel arrays that i have to sort alphabetically using the Sort Option in the menu bar. I am using Bubble sort, to sort the … | |
hi there i am trying to creat a subtotal for each row i have created and for each item in the combo box i dont know how to do this can some help plz [CODE] /* * To change this template, choose Tools | Templates * and open the template … | |
Hello there, I am using the JTextPane in my Java Swing Application. How do I make it Handle Hypelinks. Like lets say the use enters [COLOR="Green"]\\some_foldername\some_subfolder_foldername\some_file.xls [/COLOR]or any other file type, It should Automatically, treat it as a hyperlink. Is it Possible to have such a functionlaity [B][U]JTextPane Hyperlink Functionality[/U][/B] … | |
Good Day, I am also a newby to the JAVA world of developing. I am SERIOUSLY struggling with a homework assignment ... I have a swing program that is using a JFrame and the task is to calculate the average grade. First, a JOptionPane needs to be used to get … | |
problem i'm having is getSelectedRows() and getSelectedColumns().... they dont return anything when i select the rows. am i doing it wrong? i need it so when the button is pressed to output the selected strings[] [CODE]import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.*; import javax.swing.table.AbstractTableModel; import java.io.*; import … | |
assistance with the following code: 1. package triangleMod; 2. import java.awt.Dimension; 3. import java.awt.Frame; 4. import java.awt.Point; 5. 6. import javax.swing.JFrame; 7. 8. 9. public class Main extends Frame{ 10. 11. static Point a; 12. static Point b; 13. static Point c; 14. static Triangle tryAngle; 15. static JFrame frame; … | |
[CODE=Java] package ce.ass2; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; import java.util.logging.Logger; import ce.board.Board; import ce.board.MoveData; import java.awt.Color; import javax.swing.JButton; public class TickerBean extends JButton implements java.io.Serializable{ int timeDelay=500; private LifeBean lb=new LifeBean(); private Board tickerBoard; private javax.swing.Timer t = new javax.swing.Timer(timeDelay, new ActionListener() { public void actionPerformed(ActionEvent e) { try … | |
This is chatting program using etherframe packet. I finished crc, gui , making packet and sending packet. but I can't implement stop and wait timeout resend... I can't implement it.. can anybody help me? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import java.io.*; import java.net.*; public class ChatJin implements … | |
hi! i have to write a gui window, which draws sierpinskys triangle recursively, i have one main class: [CODE]package triangleMod; import java.awt.Dimension; import java.awt.Frame; import java.awt.Point; import javax.swing.JFrame; public class Main extends Frame{ static Point a; static Point b; static Point c; static Triangle tryAngle; static JFrame frame; private static … | |
![]() | Hey All, I've been working on this code for a while now, but can't quite come up with a working solution. I'm trying to make a specially designed ImageButton, which extends JButton. Basically, it replaces the regular JButton image with another image. I've figured out everything except this. Every button … ![]() |
Hi, i am making an event calender but i'm stuck with making sure that a user choose a valid date (a user should'nt be able to choose a start date that is after the end date). Could anyone point me in the right direction please? My code is still a … | |
I am trying to put together a simple inventory program for my class, but I keep running into one error that I just cannot seem to correct. Here is my code: public class DVD extends Product { // channel that the show was on private String channel; // constructor public … | |
[COLOR="Green"]Hello all.. I have a problem with my program in here. I am making a chatting application and i just need a final touch. This is the code snippet i make to represent my problem. First, i'd like to tell that i want to make the sending process like the … | |
Hello yet again =) I am required to create a program that consists of two classes. The driver class calls on the other class to set/get radius and height variables and calculate the volume of a cylinder. The problem I am having is that; I create two objects with two … | |
I created a class that takes a 3 dimensional array and puts it in a txt file, the method is called output(). I can't figure out where to call the method though. I'm trying to have it so it is called when numb=4 in the actionListener on the bottom. Please … | |
[code="java"] import java.awt.BorderLayout; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.*; public class SketchPad { public static void main(String[] args) { SketchPad sketchpad = new SketchPad(); sketchpad.gui(); } public void gui() { JFrame mainF = new JFrame(); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("file"); mainF.setJMenuBar(menuBar); … | |
i think theres something wrong with my computer, im trying to create a GUI for my program but it wont display my JLabels (which contain images) i downloaded a program with a GUI i made at the computer lab in my university which works there, but on my laptop it … | |
My input file has 84 integers and I'm not sure what I'm doing wrong. PLEASE HELP! import java.util.*; import javax.swing.*; import java.awt.*; import java.util.Scanner; import java.io.*; public class Museum { private int Week=3; private int Hour=4; private int Day=7; int[][][] visitors = new int[Week][Day][Hour]; private int[] allWeeks; private int[] allHours; … | |
I have a few minor problems with this program: 1. My selectionSort method - it sorted Z - A, not A - Z. 2. Since I used a string array, I'm running into problems with "operator > cannot be applied" and "incompatible types". 3. Return "search term not found" in … | |
Hey all! I use the folowing class in my program to draw lines. However I also need to be able to delete them. So I need to add a mouselistener to the lines but I don't know how and whereto do this.. Can anybody help me with this? Thanks!! [code] … | |
I cant get the program to drawy the triangle properly. Can some help me with the draw the polgygon triangle? [CODE]/* Alex Bruso (student 2) + Tim Mumford (student 1) Hw Shape Group Exercise This program will create an applet which will draw shapes. The input from the user will … | |
Hello, i have to design and implement an application that helps a museum analyze the flow of visitors for an exhibition that lasts for 3 weeks.(The museum is opened 7 days a week for 4 hours)...well getting to the point. I need to store this information in a 3d array … | |
I am having trouble creating the snake, let alone making the animation. I need someone to assist me in creating such things, as well as helping me complete the program. Thanks [code]import javax.swing.*; import java.awt.*; import java.awt.event.*; /** * @(#)SnakeGame.java * * * @author * @version 1.00 2009/4/30 */ public … | |
I have been working on this code for some time now. It is a basic graphics package. When the user clicks the draw button I need to create a chape based upon the user's input and put the shape into an array of shape references (up to 10). I attempted … | |
Hi, i am having trouble with an assignment. i need to create an array, store numbers in the array... sqaure, cube and square root those numbers individually using different methods. display the resuts with a dialog box. after that i need to find the sum of the numbers in the … | |
Guten Tag, What we need to do is to call a variable (numbersToEnterInteger) from the main method to the total_average method. Also how do we pass the entire array to this method, rather than a single array element. Thanks in advance. Oh and also heres the code. [code] /** * … | |
Hi all, I am trying to write a simple program but I am having an error message that I am working on it for three days. The aim of program is to convert entered value depending on the clicked radio buttons. Please can someone help me about it ? Thanks, … | |
Please give me the code of a swing program which displays a button with an image on it.The image on the button should change when it's clicked. | |
I'm learning GUI, can anyone show me how to display an image on a panel. So far I have this: [code=java] import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.io.*; import javax.imageio.*; import javax.swing.*; import java.applet.*; public class JlabelDemo { public static void main(String[] args) { // create an image icon, … | |
i have problem that in showpane Modify and Delete pane3 eventhough clicked delete button for the action but the combobox "Select Book" doesnt update in the list that the deleted book still exist. What happen ? any guide ? thx in advance . [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import … | |
I getting an error from a code that I have been working on. The error is Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at sample2.AdditionalMethods.main(AdditionalMethods.java:57) My code for the information is package sample2; public class shape { private String Name; … | |
I am having trouble printing onto a JPanel. I am able to print any string that i want to. here my code: [CODE]import javax.swing.JFrame; import java.awt.BorderLayout; import javax.swing.JLabel; public class TestDraw { public static void main(String[] args) { final int WINDOW_WIDTH = 300, WINDOW_HEIGHT = 300; DrawPanel panel = new … | |
I'm using netbeans and I have a problem. I'm using a card layout to flip between multiple windows. Two of these windows are wider than the others, and this cannot really be helped. Ideally, it would be best to design each window so that they are all the same size, … | |
Hi All, As you've probably read a million times, I am a newbie to java programming and need some help with uni assignment. I need to know how to numerical update a Textarea by clicking on a button. This would be a lot simplier if I could do it one … | |
Hey all, My program creates panels with textfields. The actual goal is to draw lines between the textfields. But i'm stuck way before that stage. I can draw lines with the button connection lines and you click on two points and it draws a line. The 2 problems I have … | |
When I try to print data to a file, I am getting an error dealing with security saying that I don't have permission to write to a file. Can anyone help me out? Here is the code //import packages import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.io.*; import java.util.*; import … | |
I am having a difficult time with this one line of code for my homework that is due Sun.: Modify the Inventory5 Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item … | |
[CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class LoginScreen extends JFrame { JLabel userId; JTextField userIdT; JButton userIdHelp; WelcomeLogin welcome; public LoginScreen() { super("User Login Screen"); Container surface = getContentPane(); setSize(1024,750); setDefaultCloseOperation(EXIT_ON_CLOSE); setLocationRelativeTo(null); surface.setLayout(null); welcome = new WelcomeLogin(); surface.add(welcome); userId = new JLabel("User ID :",JLabel.LEFT); userId.setBounds(20,50,80,20); surface.add(userId); userIdT … | |
Hey, Does anyone know how I can draw lines between the textfields? If I ask for x and y then this is relative to the component itself.. Also now I have made a separate class but this means that when I draw the lines the textfields disappear they cannot exist … | |
Hi all, Could you please sugest me some code for building the GUI to browse a file and to upload using Swing. Thanks, | |
I am new to using swing and I am trying to find a good way to organize a window with multiple tabs. I have found the info on Sun's website but I still need to manipulate the positions and alignments of those tabs more than what it covers. I also … | |
hi am new to java and have a problem in displaying the x and y points on the graph to solve this ax3+bx2=x+d=0 here is the code import java.awt.*; import javax.swing.*; import java.awt.event.*; /** * PROGRAM: Cubic * DESCRIPTION: This program solves the cubic Equation for a given range of … | |
I am trying to create random rectangles and ovals. This is what i ahve so far: [CODE]import java.awt.Color; import java.awt.Graphics; public class MyRectangle { private int x1; private int y1; private int x2; private int y2; private Color myColor; //constructor with input values public MyRectangle( int x1, int y1, int … | |
I have tried to make a chat application that only saves the recieved messages which can then be deleted. I'm having some major problems with it. Can anyone please point out or correct my coding. I have tried for ages to get this working but with no joy. Client Code … | |
Hey guys, I am doing my game project but i get this error everytime i press high scores button...can any one explain what this error means? Thanks in advance :) j Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1 at HighScoreManager.readHighScores(HighScoreManager.java:22) at StatusView$1.actionPerformed(StatusView.java:71) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at … | |
Alright, I'm trying to import data from a text file into an array, the data represents different properties of buildings that are to be drawn on a panel. I have 3 classes, Building3 which represents an individual building, CityPanel3 which represents the panel that the buildings are drawn upon (also … | |
Ok...The assignment is to create a mortgage calculator with a GUI that asks for the principle amount, has a drop down box that allows the user to select an interest rate and term (ie 7-yr at 5.35%) and displays the informat, payment, and an amortized payment schedule...I beat my head … | |
I wrote this simple java program to test the repaint mechanism in Java for my Eclipse IDE (not that it works on XCode either). The repaint() mechanism is not repainting, it does not erase the code previous to it in the graphic. It should according to everything I've read. Help … | |
Hello, I am having a null pointer error, don't know where it came out. Can someone check this code for me please: The error is in the sendBytes methods, I have put a comment over there, actually there are two null errors. 1. [code] pw.println(filenm);[/code] 2. [code]out.write(buffer,0,bytes);[/code] Thanks a lot … | |
Hello everyone, Actually I want to learn more about thread, can we have more than one "run" for thread in a program ? [code] package ignisftpv20; import javax.swing.JFileChooser; import java.io.*; import java.net.*; import javax.swing.JOptionPane; public class FTPClient extends javax.swing.JFrame implements Runnable { JFileChooser fileChooser = new JFileChooser(); File fileUpload; ObjectInputStream … |
The End.