3,978 Topics

Member Avatar for
Member Avatar for seanj1992

hi everyone, i am doing a pizza ordering Gui. i am stuck on 2 things, i am trying to get the receipt string to store the items that are checked. they are multiplying when they are displaying. the second is displaying the string in the jtext area, any help woud …

Member Avatar for Traevel
0
187
Member Avatar for haneenmegren

and i have more than one class this is my java file and im using netbeans import java.applet.*; import java.awt.*; import java.net.*; import java.awt.event.*; import javax.swing.*; public class sb extends JApplet { Thread threadABC; AudioClip gong; /** * Initializes the applet starbucks */ @Override public void init() { resize(920,700); /* …

Member Avatar for haneenmegren
0
231
Member Avatar for shayan_doust

Hello there. Currently, I am trying to develop a graphical number guessing game in JAVA. This is my first project in java. Here is an insight in the application: When the application is first opened, a random number (1-100) is assigned to a variable. When the user enters their guess …

Member Avatar for TekknoDraykko
0
535
Member Avatar for Doogledude123

I'm making one of those puzzle games that has the empty tile which you need to slide them around to finish the picture. When I refer to the "Active Tile" I'm referring to the tile that's empty on the board. I'm changing the position of the active tile and the …

Member Avatar for JamesCherrill
0
250
Member Avatar for shahera.arafat

hi :))) I have a pro. here which I can't use the keyListener and the buttons (ActionListener )at the same time !! I can use once a time either the keylistener OR ActionListener ! and in my prog. I should use both of them at the same time ! what …

Member Avatar for JamesCherrill
0
426
Member Avatar for shahera.arafat

Hi everyone :)))) there is a problem here !this code should draw a rectangle whenever I presse on the mouse ! but actually it doesn't do that !! when I execute the prog. it gives me the frame window ! but when I presse the mouse ,it should draw a …

Member Avatar for shahera.arafat
0
111
Member Avatar for andruluchko

Hello, I try to rename file or directory using JFileChooser() and JButton(). But it gives me a NullPointer exeption. I have FileChooser, Button and TextField where I write new name for my file or directory. Can you say where I go wrong and how to solve this problem. // button …

Member Avatar for mKorbel
0
1K
Member Avatar for shahera.arafat

hi everyone :) I have a problem here >>which I can't add 2 numbers >> and I don't know what is the solution for that !!>>it always gives me an empty result !and that is because (num2) always parse a (null) value ! so how can I edit the value …

Member Avatar for shahera.arafat
0
301
Member Avatar for game123

Hi, Im slightly stuck with a java project ive been asked to do. The problem is the game is a simon game so I the computer picks a letter randomly and the player has to copy it, if the player picks the wrong letter in the sequence the game informs …

Member Avatar for jwow
0
2K
Member Avatar for Ragunath_1

I want to automate an application developed in java and swing controls using python. I tried pywinauto but it is not able to detect java objects. I tried using QTP but my applications dynamic java windows dosen't hava parent window so not able to use it . Any suggestion of …

Member Avatar for vegaseat
0
70
Member Avatar for Shilpa_3

I am trying to develop an interface for my hotel reservation system where for a particular date, the interface should display rooms that are booked so that the staff can book the rooms that are available (similar to airline seating reservation system which displays reserved and open seats) Can I …

Member Avatar for stultuske
0
191
Member Avatar for compscigirl

Hey everyone! I have to write a program that generates random shapes in a window, but when the window is resized the program can still remember the shapes and redraw the same ones. My code so far draws the random shapes, but when I resize the window, the shapes change …

Member Avatar for mKorbel
0
212
Member Avatar for jjones0150

I'm having trouble working these last few kinks out my progarm. It would be greatly appreciated if you can help me out from here. import java.util.Date; import java.util.Scanner; import java.io.FileReader; import java.io.FileNotFoundException; import java.io.PrintWriter; import javax.swing.JOptionPane; import javax.swing.text.BadLocationException; public class aCircle { public double circumference(double cRadius) { return cRadius; } …

Member Avatar for stultuske
0
230
Member Avatar for amogh.max

I have created the following button: <form method="post" action="website.sup"> <input type="submit" id="btn1" name="btn1"/> </form> I am trying to call a ".java" file when i press this button. Sample of my .java code : package website; import javax.swing.* public class sup implements Runnable{... How do i call my java file? Additional …

Member Avatar for stultuske
0
276
Member Avatar for haider885

package filehandling; import java.awt.event.ActionEvent; import java.io.*; import java.awt.*; import java.awt.event.ActionListener; import javax.swing.*; public class Filehandling extends JFrame{ JTextArea ja; JButton jb; Filehandling() { setBounds(400,400,400,400); setTitle("azeem"); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container cont= getContentPane(); ja=new JTextArea (); cont.add(ja,BorderLayout.CENTER); JPanel jp= new JPanel(); jb=new JButton ("Save"); jp.add(jb); cont.add(jp,BorderLayout.SOUTH); setVisible(true); } public static void main(String[] args) …

Member Avatar for mKorbel
0
312
Member Avatar for EarhawkPH

Hi Guys! I'm having trouble on briefcases having the same value. for ex: i choose briefcase 1 = 5000, briefcase 2 = 5000 how do i make the briefcases have a unique value? Note: the value of briefcases are randomized import javax.swing.*; import java.awt.*; import java.awt.event.*; public class DoND extends …

Member Avatar for iamthwee
0
418
Member Avatar for ali11

everything is working fine except Encryption button. import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; public class encryption extends JPanel implements ActionListener { char [] str= {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' }; char [] str1={'1','2','3','4','5','6','7','8','9','0','!','@','#','$','%','^','&','*','(','_','_','+','=',',','.','?'}; char [] a= new char [50]; char [] b= new char …

Member Avatar for JamesCherrill
0
279
Member Avatar for Nation

I have a JTable that a user can input data. I have an image that I would want to put at the top of my page when printed and also another image that I would want to work as footer. How do I print these on the same page including …

Member Avatar for mKorbel
0
1K
Member Avatar for SANJAY.N.MHATRE

Java swing component jtabbedpane is opaque even after jtabbedpane.setBackground(new Color(0,0,0,0)); or jtabbedpane.setBackgroundAt(index,new Color(0,0,0,0));

Member Avatar for JamesCherrill
0
35
Member Avatar for Gl753

Sorry for the misleading question guys, I know how to generate two random numbers but I want to use them in One JOptionPane input Dialogbox so the user can add the two numbers. Below is my code of what I have done so far I know it's not a lot …

Member Avatar for Gl753
0
459
Member Avatar for Nation

I have a JTable that has four columns. In the second column I have assigned a JComboBox to be the cell editor of my column.The problem that I encountered is that I cannot handle the combobox the way I want. **What I want is that after a user select an …

Member Avatar for mKorbel
0
2K
Member Avatar for shahera.arafat

I want to ask >>what is the use of (string args[])??? and how can I use system.exit >>without intially import the package (java.lang) ? thanks ^^ import javax.swing.JoptionPane; public welcome1 { public static void main (stirng args[]){ JoptionPane.showMessageDialoge(null,"welcome to java"); system.exit(0); } }

Member Avatar for JamesCherrill
0
130
Member Avatar for haider885

Here my code. package formsign; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import javax.swing.*; public class textF extends JFrame{ private JTextField fname; private JTextField lname; private JPasswordField pass; private JTextField country; private JTextField zip; private JTextField month; private JTextField day; private JTextField year; private JTextField phone; private …

Member Avatar for mKorbel
0
254
Member Avatar for SkateX

Cannot find symbol for a basic java command? import javax.swing.J0ptionPane; public class HelloGUI { public static void main (String[] args) { J0ptionPane.showMessageDialog(null, "Hello, world!"); } } c:\Users\Nathanial\Desktop\myJavaPgms>javac HelloGUI.java HelloGUI.java:1: error: cannot find symbol import javax.swing.J0ptionPane; ^ symbol: class J0ptionPane location: package javax.swing HelloGUI.java:6: error: cannot find symbol J0ptionPane.showMessageDialog(null, "Hello, world!"); …

Member Avatar for SkateX
0
230
Member Avatar for Cripop

Hey there everyone, I am currently working on and Assignment that is due tonight and I feel like I am close but can not exactly get to the end. I would appreciate any feedback possible. Kinda stuck at the moment. ---Modify the Inventory Program to use a GUI. The GUI …

Member Avatar for JamesCherrill
0
237
Member Avatar for trishtren

Hi, I have been trying to create a game loop that is paused when a certain key is pressed. This seemed to work ok in Swing but in javafx the loop locks up the UI, even if i create a seperate thread. @FXML public void setPaused(KeyEvent e) { if (e.getCode().compareTo(KeyCode.P) …

Member Avatar for trishtren
0
1K
Member Avatar for ali11

Can someobody tell me why i only see blank window. import java.awt.*; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; public class dic extends JFrame{ public JLabel label1,label2,label3,label4,label5,titlel; public JTextField ew,fw; public JTextArea txar1,txar2; public JPanel …

Member Avatar for JamesCherrill
0
220
Member Avatar for mee123

import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.swing.ImageIcon; import javax.swing.JOptionPane; public class Main { public static void main (String[] args) throws Exception { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/convocation","root",""); //ImageIcon icon = new ImageIcon("C:\\Users\\a\\workspace\\MysqlName\\img\\U.png"); //JOptionPane.showMessageDialog(null, "Custom", "Custom Image", JOptionPane.INFORMATION_MESSAGE, icon ); int id_convo= Integer.parseInt(JOptionPane.showInputDialog(null,"Please Insert Student Convo ID\n(eg:01,02,03)", "U …

Member Avatar for stultuske
0
147
Member Avatar for Benny_1

Hi guys. I'm working on a christmas present for my dad, it's a program that installs 8 Black Keys songs on his computer. I'm having some trouble with it though. I can't figure out how to get the files out of the jar file. I used to access them with …

Member Avatar for Benny_1
0
449
Member Avatar for Search_not

I am making my own component similar to the JOptionPane, but with some added GUI components specialised for my current project. I have finished with the GUI of the component, but I do not know how to make wait for the user to enter input before continuing, as the JOptionPane …

Member Avatar for Search_not
0
420
Member Avatar for rhada79

Need Assistance Please. My code is not adding the size and the toppins: import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.util.EventObject; public class PizzaCalculator extends JFrame implements ActionListener { JPanel westPanel = new JPanel(); JPanel eastPanel = new JPanel(); JPanel centerPanel = new JPanel(); JPanel northPanel = new …

Member Avatar for rhada79
0
3K
Member Avatar for ali11

getting following error: incompatible types: vmpr cannot be converted to JFrame JFrame VendingMachine = new vmpr(); import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLabel; import java.awt.*; import javax.swing.*; import javax.swing.JFrame; public class vmgu extends JFrame implements ActionListener { public JButton button[]; public JLabel label; public JLabel label2; public …

Member Avatar for stultuske
0
349
Member Avatar for kayleigh0411

My program compiles with no errors, but when I try to use it, the results do not show up and there is an error. Please help!!! import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.text.*; public class RetailSales extends JFrame { // declarations Color black = new Color(0, 0, 0); Color …

Member Avatar for kayleigh0411
0
334
Member Avatar for My_1

How do i put a flag on location that the user right click on it. and how do i put an img to all mine in game board when game is end? I try to put an img but wont work? How can i fix it? here is what a …

Member Avatar for My_1
0
697
Member Avatar for EarhawkPH

Hi! Newbie Java Programmer here! I've done a cash register program. this error's pretty unusual to me. i dont know how to fix this. import java.text.*; import javax.swing.*; import java.awt.*; public class CashRegisterV1 { public static void main (String[] args) { DecimalFormat fix = new DecimalFormat("0.00"); //QUANTITIES int Nido = …

Member Avatar for JamesCherrill
0
241
Member Avatar for rakibtg

in java jframe swing how i can use system default scrollbar style? eg. the default style looks like [this](http://i.imgur.com/3wrBufN.png).

Member Avatar for JamesCherrill
0
167
Member Avatar for My_1

Hello, I have problem with jbotton. I have botton decalre it. but how do i access it ? because I have 10X10 or 100 botton. let i want to access 95 botton how can i do that? how do i set the title? here is code import java.awt.*; import javax.swing.*; …

Member Avatar for JamesCherrill
0
328
Member Avatar for GoneGirl

Hi guys, After 10 days of googling and trying I finally must ask. This is not an assignment for school but its a practise one for the upcoming assignment in a few weeks. So i have the weights of 200 oranges in a csv file. With this csv file i …

Member Avatar for GoneGirl
0
2K
Member Avatar for mwenyenia07

Hi . I am new to java. I am implementing a functionality where by a user fills some textFields and the data is added as a new row in a Jtable.The table will hold more than one row before saving. I created the table using netbeans Swing controls. its variable …

Member Avatar for JamesCherrill
0
183
Member Avatar for PcTechnical1

first class GUI - basically trying to use my stack calculation class to use in my first class GUI in my enter postfix expression actionPerformed area? What is the best step to add my stack calculation to evaluate an expression? import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.util.LinkedList; …

Member Avatar for gusano79
0
201
Member Avatar for COKEDUDE

I was looking at these two examples and I was curious what the difference is between JCheckBox and JCheckBoxMenuItem. http://www.macs.hw.ac.uk/cs/java-swing-guidebook/?name=JMenuBar&page=3 https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/uiswing/examples/components/CheckBoxDemoProject/src/components/CheckBoxDemo.java These pictures make it look they are the same except JCheckBox is not in a menu but it is easy to add to a menu with the menu_name.add(menu_item) command. …

Member Avatar for mKorbel
0
357
Member Avatar for EarhawkPH

Hi! Newbie on Java. I'm doing this assignment for a cash register program. Our professor just explained what we're gonna do and stuff. Here's what i understood: 1.)Sales report (my code appears on the first diag box) Product ID Product Name Quantity Price 2 Stuff 100 3 Stuff 100 4 …

Member Avatar for stultuske
0
364
Member Avatar for ali11

import java.util.ArrayList; import javax.swing.JOptionPane; public class ClientList { private ArrayList<Client> clientData; private final String NEW_LINE = "\n"; private int cursor; //manager mode public ClientList ( ) { clientData = new ArrayList<Client> ( ); buildClientList ( ); if (clientData.size ( ) != 0) cursor = 0; //not empty, place cursor at …

Member Avatar for Slavi
0
182
Member Avatar for COKEDUDE

I am having issue with jmenu popup in netbeans. It only sometimes works. Sometimes I don't get a java popup at all. Sometimes my File and Edit options are completely missing. This is what my code looks like. import javax.swing.*; public class menu { /** * @param args the command …

Member Avatar for Slavi
0
125
Member Avatar for gajen007

I designed a swing interface with MySQL table. I put two comboboxes in a manner when the 1st combobox value is selected (Brand Name), the second combobox values (available items under thise selected brand) will be loaded via a mysql query. My code is... try{ String url = "jdbc:mysql://localhost:3306/databasename"; String …

Member Avatar for stultuske
0
988
Member Avatar for 2384443

Hi everyone, i need your help, i've used a panel and i've a label(which acts as a background image).. There's a long text which is placed in a label. now i want to view this text and the background image but in this attempt i cant see any scrollbars even …

Member Avatar for juanpa_2510
0
235
Member Avatar for JamesCherrill

Although layout managers usually scale text properly, with the spread of "retina" Macs with screen resolutions over 200 d.p.i. we can't just keep ignoring pixel size for grahics or animation. Toolbox has a method for getting the screen resolution, but I don't have access to enough varied machines to see …

Member Avatar for Slavi
0
197
Member Avatar for marvin.lerias

package Assignment2; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class AuctionDialog extends JFrame implements ActionListener { private JLabel lblOutput; private JTextField tfBidder; private JTextField tfPainting; private JTextField tfAmount; private JTextArea taOutput; private JButton btnSubmit; private Painting paintings; private Bid bids; private Auction artworkAuction; public AuctionDialog( ) { artworkAuction …

Member Avatar for marvin.lerias
0
284
Member Avatar for Nikki_77

Write a class named Car that has the following fields: yearModel. The yearModel field is an int that holds the car's year model make. The make field references a String object that holds the make of the car speed. The speed field is an int that holds the car's current …

Member Avatar for stultuske
0
22K
Member Avatar for marvin.lerias

package Assignment2; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class AuctionDialog extends JFrame implements ActionListener { ` private JLabel lblOutput;` private JTextField tfBidder; private JTextField tfPainting; private JTextField tfAmount; private JTextArea taOutput; private JButton btnSubmit; private Painting paintings; private Bid bids; private Auction artworkAuction; public AuctionDialog( ) { …

Member Avatar for marvin.lerias
0
281

The End.