3,978 Topics
![]() | |
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 … | |
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); /* … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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; } … | |
![]() | 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 … |
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) … | |
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 … ![]() | |
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 … | |
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 … | |
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)); | |
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 … | |
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 … | |
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); } } | |
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 … | |
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!"); … | |
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 … | |
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) … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … ![]() |
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 … | |
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 … | |
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 … | |
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 … | |
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 = … | |
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). | |
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.*; … | |
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 … | |
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 … | |
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; … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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( ) { … |
The End.