3,978 Topics
![]() | |
I am getting the following Errors when I am linking the .pdf document I am using the following piece of code[CODE] String lPathPrefix = "file://muceap10.muc.amadeus.net/User Step Folders/BPS_Files/Outlooksoft CPM/01 - Production Environment/01 - Documentation Library/01 - Documents/Daily_Checks/"; String lPath = (lPathPrefix + doccolvalue).replace(" ", "%20"); URI lURI = new URI(lPath);[/CODE] java.awt.Desktop … ![]() | |
Hi!! I have written three classes (two of which are most relevant) and am required to construct an operating calculator. This is the CalculatorPanel: [CODE]/* * CalculatorPanel.java * * Lab 19, COMP160, 2010 * * An alternative GUI front end for the Calculator class * */ import javax.swing.*; import java.awt.event.*; … | |
Hi, I'm working on a program with GUI and I'm having a fair amount of trouble with the following code. As you can see below, I have an application and a support class. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class StyleOptionsPanel extends JPanel { private JLabel saying; private JCheckBox … | |
trouble putting together program for designing catface that will resize in the frame import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import javax.swing.JPanel; import javax.swing.JComponent; import javax.swing.JFrame; import java.util.Random; import java.awt.geom.Arc2D; import java.awt.BasicStroke; /** * A component that draws a Cat Face. *@Kevin Bennett */ public … | |
I need to create a custom panel that displays X,0, or nothing, randomly. It is supposed to be something like a tic tac toe board. The only thing is, when you open it it must randomly place the x's, 0's, or blank spaces, and when the screen is resized by … | |
Hi Netizens, I wish you guys can guide me in here. In the following code, I've compiled flawlessly and I didn't managed to get the output screen and I'm kind of in the dark since I didn't find the answer that I wanted through internet browsing after a while. Any … | |
I need help with my sort. it will sort first name but when it gets to last name and DOB it wont. Please help me I tried bubble sort and it didnt work. I would like to use bubble sort. import javax.swing.*; import java.util.Scanner; /** * @(#)program 2.java * * … | |
EDIT: Never mind I figured out what to do to get the results I wanted. It came to me less than a minute after finishing my post. Thanks anyway... Hello all, I wrote the required program that I must turn in tomorrow. However I have one hangup, I am supposed … | |
[code] import java.util.*; import java.text.*; import javax.swing.*; class Lab4Part2{ public static void main (String[] args) { String ex1; Double num, F; final int a=0, b=0; JFrame myWindow=new JFrame(); myWindow.setSize(500,400); myWindow.setTitle("Calculator"); myWindow.setVisible(true); myWindow.setLocation(600,200); ex1=JOptionPane.showInputDialog(myWindow, "Enter an expression"); F=Double.parseDouble(ex1); num=(a+b); JOptionPane.showMessageDialog(myWindow, "The sum is "+num); } } [/code] I need some help … | |
Hey! guys, i need help figurering out how to make this program ran. Jack has decided his student organization is going to sell Oktoberfest shirts at Oktoberfest. In order to compete with other clubs, he wants to offer a 10% discount to anyone who buys 5 or more shirts. Also, … | |
Ok so to give you a brief summary of whats going on our original assignment was to make a password directory that adds, saves, looks up, and removes a name and password that are connected together in an array. So now we need to alter the code so it works … | |
Hey guys, im getting a null pointer exception... but i dont know what is wrong. Im trying to get data from a hashmap, and place it in a swing tabel. [CODE=java] ArrayList planes_array[] = null; //planes_array[0] = new ArrayList(); for(int i=0; i<planes.size(); i++) { ArrayList tmp_array = new ArrayList(); tmp_array.add("1"); … | |
[CODE]import javax.swing.*; import java.text.*; public class Postage3{ public static void main(String args[]){ double weight, cost, count; int choice, choice2; DecimalFormat df = new DecimalFormat ("0.00"); choice2 = 1; while(choice2 == 1){ weight = Double.parseDouble(JOptionPane.showInputDialog("Enter weight of postage according to ounces")); if(weight <= 1){ cost = weight * 0.30; } else{ … | |
i'm writing a Java program that ask the user to input words using JOptionPane.showInputDialog() Then look at each letter in the word and add up the points for each letter. Vowels (a,e,i,o and u) are valued at zero.The letters "x" and "q' are valued at 5.All other are 1.Anything not … | |
An account has the properties account number, balance, annual,interest rate, and date created, and methods to deposit and withdraw.Create two sub classes for checkings and savings account.Checkings account has an overdraft limit, but a savings account cannot be overdrawn. One problem that i'm having is that when I withdraw x … | |
I would like some help to index through an empty array and fill it with 10 entries one at a time. The objective of the task is to create a GUI with two buttons, one (Store) to save the value into array position and second (Quit) to run statistics calculations … | |
Hi all, Me again. I am having issues with a looping program. My current issue right now is that it wont compile, it keeps saying i need another perentheses at line 20. This program is suppose to calculate the investment and show for every year. The year and amount of … | |
I'm now studing Object Oriented programming course,and I want to do a gui and implement all rules of object oriented programming in it . so what's the best recommend language to do gui other wise library swing in java ?? | |
Hi there,I am stuck here.The question ask to Write an application for a university admissions office. Prompt the user for a student’s High School Grade Point and an admission test score (value from 0 to 100). Print the message “Accept” if the student has any of the following: A grade … | |
Hey guys I'm about to launch this server on my VPS and want to make sure it won't do any damage or hit my CPU cap. I've written this code for my online game which visits a page every 888ms by starting a new thread which opens a connection with … | |
[QUOTE]I am trying to make my program look like the image I attached but I don't know how to. I can't make the JTextFields positioned like that.[/QUOTE] [QUOTE]I also want to make it a JScrollPane instead of JPanel[/QUOTE] [CODE]import java.awt.*; import javax.swing.*; import java.text.NumberFormat; import javax.swing.JFormattedTextField; import java.awt.event.*; import java.text.*; … | |
I need to write a tic tac toe game that displays who's turn it is. It doesnt have to restart or have AI. Im not sure why everytime i click it repaints a different colors. I want every cell to be one solid color then depending on if its X's … | |
Hi guys, i am trying to implement elevator simulation but stuck in some ways. 1st. i would like to set the background of my elevator class area into yellow but when i tried to do so by typing app.setBackground(COLOR.YELLOW) under class Elevator, i unable to change it. 2nd. i tried … | |
Hey guys, I'm working on my first GUI assignment and I wanted to make sure I have the layouts finished and such before I move on to the coding for the calculations and such. Here's the instructions: (4 classes) [B]CreatePanel[/B] CreatePanel extends JPanel defined in the javax.swing package. It should … | |
Hi all, Having another problem with a program. I thought i had this one pretty good, i was confident about it, but no luck. The problem was with initializing a variable, i try to add in to output what the variable is and it says it needs to might not … | |
hello I need a temp fix for putting times into my form. I suspect that soon I will have to work with some kind of calender class that will send selected data in all the correct formats. I have no clue. BUT right now it stop me in the first … | |
MusicSys:unsolved JDesktop:JInternalFrame out of scope ///////////////////////////////////////// Hello; I Have a JDesktopPane that opens with a x frame (JInternalFrame)wit a JMenuBar and 11 JTabbedPanels .produced by x.class.I click the menuItem to produce z.frame using x.class a new JInternalFrame with 4 tabbedPanels on it again produced by x.class. Now I click on … | |
Hi! I am just a newbie here! I just wanna ask how to do the file handling in java applet? Do I have to do the certain policy/permission to perform it? If so, how would I do it? And another one, how can I close the APPLET WINDOW once I … | |
j ///////////////////////////////////////// Hello; I Have a JDesktopPane that opens with a x frame (JInternalFrame)wit a JMenuBar and 11 JTabbedPanels .produced by x.class.I click the menuItem to produce z.frame using x.class a new JInternalFrame with 4 tabbedPanels on it again produced by x.class. Now I click on x.frame and try to … | |
Hey guys I am stumped. My code worked fine until I added the calculations: [CODE]else{ interestRate = rate[choice]; termLoan = tYear[choice]; }[/CODE] :\Users\Mom\Desktop\DuttonWeek4.java:252: incompatible types found : double required: javax.swing.JTextField interestRate = rate[choice]; ^ C:\Users\Mom\Desktop\DuttonWeek4.java:253: incompatible types found : int required: javax.swing.JTextField termLoan = tYear[choice]; ^ 2 errors Tool completed … | |
![]() | import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; class NewUser //extends Variable implements ActionListener { JInternalFrame ifrm; JLabel lbleid,lblena,lbleadd,lbletp,lbleage,lbluse,lblpas,lblcat; JTextField txteid,txtuse,txtena,txteadd,txtetp,txteage,txtpas; JButton btnadd,btndelete,btnclear,btnsearch,btnupdate; JComboBox cmbcat ; public JInternalFrame display() { JInternalFrame ifrm=new JInternalFrame("User Process",true,true,false,false); // ifrm.getContentPane().setLayout(null); ifrm.setSize(600,600); ifrm.setLocation(0,0); ifrm.setResizable(false); ifrm.setDefaultCloseOperation(ifrm.DISPOSE_ON_CLOSE); ifrm.setVisible(true); JPanel p; p=new JPanel(); p.setLayout(null); //pic =new JLabel(new ImageIcon("Employee.jpg")); … |
I have a complex UI with little screen real estate, so I'm trying to allow users to manage contents of a combo box using a right-click context menu. But I'm having trouble getting the combo box's drop down list to appear at the same time as the pop-up menu. I've … | |
Hey, I was thinking of trying to write my own custom swing component. I was thinking of a simple text based component that would act like an open book. Text would be displayed on the left side/page of the component until there is no space left and then the rest … | |
I am trying to make an Inventory GUI application using MySQL and NetBeans. So far, i was able to do add,delete,search, and save using Java Desktop Application. I now have to add a SEARCH button, a notification for the quantity if it is less than 10 and a USERNAME and … | |
Hello my friends I have a txt file with the follow layout [QUOTE] error1 255 error2 34 error5 111 error3 23 [/QUOTE] and what i'm trying to achieve is, from this text file plot a trend chart with the errors and respective quantity! this is the code that i'm using.... … | |
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MenuDemo extends JApplet { // Text fields for Number 1, Number 2, and Result private JTextField jtfNum1, jtfNum2, jtfResult; // Buttons "Add", "Subtract", "Multiply" and "Divide" private JButton jbtAdd, jbtSub, jbtMul, jbtDiv; // Menu items "Add", "Subtract", "Multiply", "Divide" and "Close" private … | |
So even though this is a simple project, I found a lack of good code on the web under this topic for multi lined strings. I thought I would share it with everyone. Hope it helps you! Prints file foward first, then in reverse (and yes there are many different … | |
Hello, I'm really new to doing Java only been doing it about 2 month so really a novice. I'm currently attempting to make my first app that is not a school project. I want to embed the current time in my application that is pulled from the local system. It … | |
i have made this code which displays all the values in JTable can any one help me out how to get report of those data.this code is just the module of my library project .Now i want to generate a report for it . [CODE] import java.awt.*; import java.awt.event.*; import … | |
trying to make a payroll program, im pretty sure this is all the code i need. maybe 1 or 2 maybe 3 extra lines. ERRORS: operator * cannot be applied to java.lang.String operator * cannot be applied to double,java.lang.String operator * cannot be applied to double,java.lang.String ERRORS in CODE are … | |
Good Morning, Having all kinds of problems with my programs. Seems as though is trying to read the StudentList file but cant. Im confused. I run the program and it goes to the StudentList.java and gives the errors below after the code. PLEASE HELP! project is past due and the … | |
[CODE] import javax.swing.*; // Needed for swing classes import java.awt.event.*; // Needed for the action listener import java.io.*; // Needed for the file and IOException import java.util.Scanner; // Needed for the scanner class import java.util.List; // Needed for the arraylist import java.util.Arrays; // Needed for the arraylict class /** This … | |
The timer is not working perfectly. it gives a very off estimate of the elapsedtime each time. Please Help [code] import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.util.Random; public class JumpingPanel extends JFrame{ public static final int BUTTON_WIDTH = 45; public static final int BUTTON_HEIGHT = 45; static … | |
I have 22 errors for cannot find symbol.....Please help! [CODE] import javax.swing.*; //needed for swing classes import java.awt.event.*; // needed for the action listener import java.awt.*; //needed for the boader layout class import java.io.*; //need for the file and IOException import java.util.Scanner; // needed for the scanner class import java.util.List; … | |
I designed to look like that picture click here: [url]http://i195.photobucket.com/albums/z285/boiishuvo/eg.jpg[/url] But I got two errors shown below: Pizza.java:150: cannot find symbol symbol : constructor Labels(java.lang.String) location: class Labels localJPanel5.add("North", new Labels("PIZZA")); ^ Pizza.java:187: cannot find symbol symbol : constructor Labels(java.lang.String) location: class Labels localJPanel12.add(new Labels("PRICE")); ^ Can anyone fix that … | |
I am hoping I can get some help from you guys, I am taking a computer security course and we need to write a Caesar Cipher program, where you can input the text and offset and get the the encrypted results back. I have run into a problem with it … | |
I'm taking a Java Class and this is the assignment: "..Modify your withdraw method so that it that checks the customers balance against a potential withdrawal. If the amounted requested for withdrawal exceeds the balance, deny the attempt to withdraw money and let the customer know." I have the if … | |
Good evening, I am trying to simply open a folder located on my local C:\ drive, to be exact just for testing purposes I am trying to open C:\temp folder. What I have is a JFrame with a single Jbutton and some code, however when I execute the button, nothing … | |
My main idea is to link the three combo boxes I had taken appSet, app, package comboboxes Now when I select one iten in appSet then the remaining two comboboxes should show the data related to the selected item in the appSet and when I select one item in the … | |
Hi all, I am getting the following error when I am loading the data into the ComboBox and the ComboBoxes are linked to each other I am getting the errors as below Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at client.cpm.dailyT20.CBRCPMDailyT20View.appComboBox_actionPerformed(CBRCPMDailyT20View.java:235) at client.cpm.dailyT20.CBRCPMDailyT20View.access$1(CBRCPMDailyT20View.java:234) at client.cpm.dailyT20.CBRCPMDailyT20View$2.actionPerformed(CBRCPMDailyT20View.java:227) at javax.swing.JComboBox.fireActionEvent(Unknown Source) at javax.swing.JComboBox.contentsChanged(Unknown Source) at … |
The End.