3,978 Topics
![]() | |
Hi! I have a problem with getting an arraylist to work within a JList. I have posted 5 classes; a GUI class - GrafikInl6, a class with most of the methods - Functionality, and then an abstract baseclass Runner6 with the two subclasses EliteRunner6 and Jogger6. My problem is the … | |
I need the node sorted (selection sort) whenever the data is entered front or end or deleted front or end. How to get it sort automatically everytime user entered a data? countItems() doesn't seem worked to the selection sort... This is my Node class. Mostly no problem... [CODE] public class … | |
Please help me =( I'm not native english speaker, therefore some things might be not clear here I have 2 separate files: [B]Main.java[/B] and [B]Open.java[/B] inside [B]main.java[/B] there is a GUI and it has a [B]JTextArea[/B]) where i want to show text (variable) called from [B]open.java[/B] in [B]Main.java [/B] i … | |
Well, I am actually making a custom 2d turn based gaming engine in Java. So far I have actually gotten a solid based down, the ability to load a seamless game world (no instances) as well as a layered world, with a terrain layer, buildings layer, unit layer then an … | |
Hi, I am building a game in which i have used array for applying 52 button, which works fine.But when i try to use Action Listener with the array of button and try use setEnable(false)or true it does not work.I am also sending my. [CODE] import javax.swing.*; import java.awt.BorderLayout; import … | |
Hi, I have a problem in repainting in a JPanel. Situation: I have a ButPanel which extends JPanel. In this panel I draw some sequences with some text along with it, by overriding paint() method. Eventually the screen size exceeds as input increases I use a CompareFrame which extends JFrame. … | |
Hello, I try to do a program that can search whatever the user typed. But I kind of having a problem, which I cannot select everything matches. For example, I type "Hi there hello, what is your name ? please say hello" The I click on the search button. It … | |
Hi! I'm writing a Java simulation of a physical system. I wrote the whole simulation without any problems and later decided to add very simple GUI to paint the current sate of the system after each iteration. This is where the first problem occurred. After creating my JFrame and JPanel … | |
I was creating this code and I hit a brick wall. Maybe because I have been doing this code for 5 hours and I am burnt out. I just need help to get it working please. Here is the code [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Random; public class … | |
I'm a newbie at java and I need help in coming up with the correct answer for this JOption java program. I enter in 2k, 30fps, 4min, 0seconds, and I should get 10.6842041GB (16.02630615GB total space needed). Please let me know if you have any advice on how I could … | |
Hi I am trying to ride a program that answers a mathematic equation but I keep getting the the error Exception in thread "main" java.lang.ArithmeticException: / by zero at EquationCalc.main(EquationCalc.java:48) I cannot get around it, does anyone have any ideas? [code]import javax.swing.JOptionPane; /** This program will calculate an equation following … | |
Hi All, I need to write a class to draw and add some components on frame like images,rectangles. I have a class which is already written by some other person, and now i need to add 14 adjacent rectangles on the existing frame. [CODE] import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; … | |
Sending one image works, but when i repeat the cycle again it just doesn't work. my Client side code (excerpt): [code] for(int i=0;i<50;i++){//fromServer.contains("image") img = ImageIO.read(in); System.out.println("Got image."); label = new JLabel(new ImageIcon(img)); scrollPane.setViewportView(label); fromServer = reader.readLine(); }[/code]On the client side i have this output [code]Got image. Got image. Exception … | |
I am having a problem with my final assignment. Now it began with an apology from my prof on the said assignment because for the pass 9 weeks we have done projects that has focused on a small part like change colors, stream, inheritance, etc. Now the final is to … | |
Hello Daniweb users, I am developing a small client for messaging, the messaging part is okay! :) Now the problem is with the GUI. I want to implement a "tabbed chat interface", similar to that of MSN or iChat. I am implementing a JTabbedPane for each "window". My problem is, … | |
Hi All, I hv written a java swing class in Eclipse IDE. i hope the code is 100% correct but when im running the class, the error message is displaying in the console. As [COLOR="Red"]Exception in thread "main" java.lang.NoClassDefFoundError: com/cname/lct/madm/gui/madmplugin/rani/ConfirmExitDialog[/COLOR] Below is my code [CODE] package com.cname.lct.madm.gui.madmplugin.rani; import java.awt.*; import … | |
Hi am creating a simple Java calculator and I keep getting the error: DylCalc.java:21: cannot find symbol symbol : variable Total location: class DylCalc JOptionPane.showMessageDialog(null,value1+" - "+value2+ "="+Total); ^ Here is my code is anyone has any Ideas: import javax.swing.JOptionPane; /** This program is a simple Addition, Subtraction, Multiplication and … | |
[code]import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.io.*; class ll{ public static void main(String[] a) { FileReader fr; try { fr = new FileReader (new File("C:\\University Study\\Component Engineering\\Assignments\\Assignment !\\yourFile.txt")); BufferedReader br = new BufferedReader (fr); String line = br.readLine(); while (line != null) { System.out.println(line); line = br.readLine(); … | |
This is the error I'm getting. Exception in thread "main" java.lang.StackOverflowError at knapsack.knap.knap(knap.java:16) I would really apprciate the help. Thanks in advance. [CODE] package knapsack; import javax.swing.JOptionPane; public class knap { static int N; // Number of items static int [] size; static int [] val; static int [] maxKnown; … | |
Heya. I require assistance regarding one of my Java programs. As the program is rather large I'm unable to post the source. The problem, My program will not start once I try to execute the Jar file associated with the program. Platform, Netbeans IDE 6.8 Description, I've written this program, … | |
Man!! I'm freaked out, I'm not able to do it Actually I add dataValues 2d array and colNames array in new created jtable but it doesn't work. Don't know why :S I also wanted to add button before the table but that's doesn't work even... PLease help me... [CODE] /* … | |
Hello Guys I need help with adding new row in a JTable. I have created the JTable using Netbeans IDE under Swing Controls. Then I removed all the columns, so that I would add them manually. Now, the function GetFlightInfo() returns an ArrayList with n numbers of rows with 6 … | |
I have to write a program that creates a GUI and asks the user to select from a group of buttons which time of the day they made the call, and input in a text field how many minutes the call was. for the day time, it's supposed to be … | |
Hey for some reason my rectangles are being drawn after the start variable has been incremented all the way through. This is causing them to go off the screen. What i wanted, is like in the code, i want it to draw, increment draw increment until the loop is finished.[CODE]import … | |
I'm trying to make a html editor. I need to set different colors for different words... I managed to the change text's background color, but not it's foreground. Can some one help me? this is my code [code=java] public class HEditorView extends FrameView { public HEditorView(SingleFrameApplication app) { super(app); initComponents(); … | |
I'm trying long distance learning & I'm having many issues. I was able to write a program that runs well using an IF loop. but now I am to use that same exact program with a WHILE loop & I just can't understand any explanation I receive from the instructor. … | |
This is code I've taken from another website, and adapted to work with the JFileChooser. I got it working so that someone could select a java file with the chooser, and I'd send a "java -jar FILENAME" to the console and the app would launch. However as soon as I … | |
Hey, so I'm trying to make a text-based game using mostly Swing GUI; the code I have so far is below. When I use JOptionPanes I modify the icon, title, and suchlike on them, so I have about two lines of code for every JOptionPane. I created methods for them … | |
I need a little help with this code, I cannot get it right, and i know it is something simple that i am missing. Can someone help me out please. [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.DecimalFormat; import java.util.*; import java.lang.*; import java.text.NumberFormat; public class week2 extends JFrame … | |
I am losing a value in the array with my bubble sorting and the sorting does nothing. Here is the Items Class [CODE] public class Items { // * A String instance variable to hold the item name private String itemName; // * A double instance variable to hold the … | |
Hello: I have a frame that shows rs from a db. I also can show the hodgepodge of code dealing with how a table could be manipulated. I am trying to cipher out what is needed to simply add a empty editable row to the table when it builds.I do … | |
Hello everyone! I'm trying to make a "map creator" program, which allows you to place 75x75 isometric tiles in a grid. I'm drawing the grid using the overridden "paint(Graphics g)" method, which you'll see in my SSCCE below. But the problem is that I'm not able to place JComponents the … | |
Hi, I have a Jtable created in swing of which one column contains check boxes. What i want is a few check boxes on specific rows.And now in the entire column Any help! :) Also i donot know the row number at which i want the check boxes.That needs to … | |
I have the program working but with using ActionListener and ActionPerformed. Instructor wants it changed since it is not the clicking the button that triggers the application but entering in '-1' as a grade. I am lost on trying to change it as nothing seems to work for me so … | |
Hello I'm new to java and i'm facing some problem... First code refers to File_Chooser class which works perfectly fine for me... [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package statguis; /** * * @author Umar Ali */ … | |
Hi, I am currently working on curling game for my High School assignment and i have lots of files of code, so i doubt anyone will want to look through them. Im having an issue in which, i have a JPanel and when i call the paintComponent (Graphics g) of … | |
This button will only appear if you move your mouse over it. See here: [url]http://mitch9654.zymichost.com/Java/index.html[/url] You hava to move the mouse around the top left my applet is this [code] /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package … | |
![]() | Hi, I'm trying to get Java to remove a JLabel from a JPanel whenever a button is clicked. Unfortunately it won't do this. I've tested my code and the button click is working for sure, so its the code to remove the component that is acting up. If anyone could … |
[QUOTE] Hello friends i have tried my code to get the values from the database n display it in JTables but i am getting two errors.please help me. [/QUOTE] [CODE] import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JButton; import javax.swing.table.AbstractTableModel; import java.awt.Dimension; import java.awt.Component; import javax.swing.BoxLayout; import java.text.MessageFormat; … | |
So my coding is a temperature converter. I have gotten everything down the way that it is wanted by the assignment except for one part. When I run the program, put in a value and select the radio button for conversion, no output ever shows up. Was hoping that someone … | |
Hi guys I need help getting an event from a button in one class, so that i can act upon it in my other class. Because the class that invokes the class that has the buttons in it is the outer class, it has no access to the buttons on … | |
Hi, I have to make a program containing 52 Buttons having icons on them and have to attach action listener so that each button could function independently. Have used array in this program and have also been able to attach action listener with the array of buttons. Action Listener works … | |
Labels would not show up in the output window. The red highlighted code is where said labels get added to the window. I can't tell what's wrong with the code and I've looked at it over and over. [CODE]import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JButton; import java.awt.BorderLayout; import java.awt.GridLayout; … | |
I have a JTable as a leaf node of a Jtree. But though I can select each row in the table I cannot select each cell element. Please HELP! Adity | |
This is my overloaded Jpanel i want to pass the event of the buttons, so that i can change the text in the jLabel in my main class listed below. [CODE]import java.util.Scanner; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Keypad extends JPanel{ private JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12; public Keypad() { setLayout(new … | |
I'VE A PROJECT AND I'M JUST START LEARNING JAVA SO I NEED HELP . HOW SHOULD I START WITH THIS PROJECT ............????? Design and code a Java application to store and manage the rates of some currencies of interest and to perform conversions between them. The application should have a … | |
Hello friends i have spend a week to make a notepad.But i have one error in it i dont know where i am wrong . i am not able to add JFileChooser in my notepad i have JFileChooser in my code but its not working properly that's why i have … | |
Estoy haciendo un programa en java donde el usuario puede jugar torres de hanoi o resolverlo solo, pero cuando hago q se resuelve solo me tira d una vz la solucion enontonces e intentado cn timers y sleeps para q pare redibuje y asi se mire paso a paso pero … | |
the program asks the user to input the number of users who wants to play. i couldn't get the result of players.length individually. each players result should be number of correct answers from the number of questions asked. please help!. [CODE]import java.text.DecimalFormat; import java.util.Random; import javax.swing.*; public class coll { … | |
code [code] import java.awt.*; import javax.swing.*; import java.awt.geom.*; public class QuestionA extends JApplet { public void init() { PanelLukis panel = new PanelLukis(this); getContentPane().add(panel); } } class PanelLukis extends JPanel { private int x_axis, y_axis; private int squareWidth, squareHeight; private int x, y, coordinateX, coordinateY, squareNo; JApplet app; public PanelLukis(JApplet … |
The End.