28 Topics

Member Avatar for
Member Avatar for Ann aiko

import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JComboBox; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; public class OtakuHigh extends JFrame{ private JLabel label, label1, label2, label3, label4, label5, label6, label7, label8; private JTextField text1, text2, text4, text5, text7, text8; private JComboBox Mbox, Dbox, Sbox, Ybox, SCbox; private JButton Qbutton; …

Member Avatar for mKorbel
0
211
Member Avatar for blue_Student

I want to have a changing output in the 2nd textfield that is 'output' in my Action class as I enter input in the 'input'textfield. I don't know why it doesn't give any output... pls help The comboBoxes convertTo---contains "IEEE" and "DEC" while precisions contain "Long", "Single", "Double". Any advice …

Member Avatar for JamesCherrill
0
237
Member Avatar for milkman93

Hey Fellas, I created 10 JTextFields using and ArrayLists: `ArrayList<JTextField> textFArray = new ArrayList<>();` textFArray.add(new JTextField()); gbc.gridx = 1; for (int i = 0; i < 10; i++) { gbc.gridy++; add(textFArray.get(i), gbc); textFArray.add(new JTextField(i)); } What I need to do: I need to get the values of what ever the …

Member Avatar for JamesCherrill
0
288
Member Avatar for aabbccbryanmark

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Burger extends JFrame implements ActionListener { JLabel lblForAll, lblBelow, pic, pic1, pic2, pic3, pic4, pic5, pic6, pic7; JRadioButton rBtn, rBtn1, rBtn2, rBtn3; JCheckBox cBtn, cBtn1, cBtn2, cBtn3; JTextField txt, txt1, txt2, txt3, txt4, txt5; JButton btn1, btn2; ButtonGroup btnG; int ham=25, egg=15, …

Member Avatar for aabbccbryanmark
0
2K
Member Avatar for zlloyd1

I have a program that creates a GUI with three text fields in it, and two of these fields is supposed to accept a numeric value. I want to know how to get the numeric entries and store them in a variable for further calculations please. I know how to …

Member Avatar for bguild
0
186
Member Avatar for 03hasnam

I am unable to execute the editProfile() method in MainMenu class. The purpose of the method is to be able to extract the bean values and display them on the empty textfield. I am not sure if i did it correctly. any recommendations for any changes to editProfile() method. public …

Member Avatar for 03hasnam
0
501
Member Avatar for Red_Rain

Hey everyone, I am attempting to add an array of JTextFields to one of my JPanels and for some reason i keep getting errors and the program crashes when i run it. I know i am prob making some noob mistake but this a project for my first Java class …

Member Avatar for mKorbel
0
659
Member Avatar for subrat_p

I have a textfield, and that only accept integer numbers. If user input charter type value it shows JOptionpane Error Message and when user click on the ok button in optionpane message the textfield clear itself public void nosgetit(DocumentEvent documentEvent){ DocumentEvent.EventType type = documentEvent.getType(); if(type.equals(DocumentEvent.EventType.CHANGE)){ } if(type.equals(DocumentEvent.EventType.INSERT)){ String ns=nos_txt.getText(); char …

Member Avatar for JamesCherrill
0
537
Member Avatar for ocw91

I was trying to reduce my jtextfield height, since it is for user to enter first name. somehow when i run the code, the box is just too big, is there anyway to change the textfield height? i tried with setPrefferedSize but somehow it showing error, mayb i put it …

Member Avatar for Majestics
0
2K
Member Avatar for blackmagic01021

I have a class that has a text area. the code is as follows package view; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.ScrollPaneConstants; public class LabelStatus extends JPanel { /** * */ private static final long serialVersionUID = 1L; …

Member Avatar for blackmagic01021
0
167
Member Avatar for blivori

have various classes representing various types of program-genres (comedy, drama etc). I have a text file filled with '-' seperated values that get read by a class called Processing and puts them into a LinkedList. I have another class GUI_g that creates the GUI. It has 3 JTables. One for …

Member Avatar for Majestics
0
255
Member Avatar for maxinville

Pls can anyone help me with a code that will help me get values in a main class from another class... I have two classes, one is user class that has the main method and the other which is process class. I am having a jtextfield and a jbutton in …

Member Avatar for maxinville
0
342
Member Avatar for blackmagic01021

I have two class. One class is for JAVA text area another class has a object. I want to print in the textarea from another class. The class with the text area. public class LabelStatus extends JPanel { /** * */ private static final long serialVersionUID = 1L; final static …

Member Avatar for blackmagic01021
0
1K
Member Avatar for rockstar03

I have been searching high and low to find something remotely close to what I am trying to accomplish and have failed, miserably. I have read Oracle and tutorials, but have a hard time comprehending everything related to java. It is all so confusing. I would just be grateful for …

Member Avatar for rockstar03
0
183
Member Avatar for jkembo

I would like to move the mouse cursor from one position to another within a Jtextfield after a condition is satisfied. I do not know what to use. Thank you

Member Avatar for jkembo
0
619
Member Avatar for ricedragon

I was given a client and server and I have to create a gui for it. I have done the entering part using the JTextField and the problem is getting the output of the class to go to JTextArea. (Its a Client server simple chat program) Here is the set …

Member Avatar for ricedragon
0
445
Member Avatar for Danielhuo

I am writing a program, but I cannot find what is wrong with the code. Only need to show one MP3, or an error message if there are any missing fields or an incorrect entry for seconds. It is not storing information about previous songs; it just display the current …

Member Avatar for peter_budo
0
842
Member Avatar for jhamill

Hey so I've been working on a lab for my intro to software developing class and have been trying to get my program to work for several days now. It's a real basic program, im sure someone will be able to figure out the issue im having. Hopefully once I …

Member Avatar for jhamill
0
221
Member Avatar for jklasd

I have a problem with getting an input from class A to class B. I already created a method which gets the value but when I call it in class b it returns empty. These are my codes: [B]CLASS A[/B] [CODE] public class log extends javax.swing.JFrame { public String name; …

Member Avatar for Anyday
0
3K
Member Avatar for javaNooblet

Hi All, I was having trouble with getting my program to display all the necessary conversions. Here is a snippet of the code to help explain what I want to do: [CODE] private class CalcListener implements ActionListener{ public void actionPerformed(ActionEvent e){ String centInput, inchInput, meterInput, yardInput; double cent, inch, meter, …

Member Avatar for NormR1
0
4K
Member Avatar for malchus

I'm having problems with my code regarding the value of the string I get with the JTextfield.getText() method my code goes this way: [CODE](keypressedevent evt){ int id=evt.getId(); char c = evt.getKeyChar; String s = JTextField.getText()+c; System.out.print(s); } [/CODE] if the textfield contains for example: apple and you type s, it …

Member Avatar for malchus
0
227
Member Avatar for niranga

Hi, I am working on a project which requires to update a JEditorPane or JTextField simultaneously by multiple clients. It is something like this. [B][1]. There are several users( i.e a group) with the same application which contains a JEditorPane. [2]. There is a group leader for a group( note: …

Member Avatar for JamesCherrill
0
274
Member Avatar for Progr4mmer

i need to access the current text of a JTextField from another method but i get an error here is the code [CODE]public Calc(){ JTextField textBox1, textBox2; setLayout(new FlowLayout()); textBox1 = new JTextField(" Time "); textBox2 = new JTextField(" Exp "); JLabel lRate = new JLabel("Rate"); JButton calc = new …

Member Avatar for Progr4mmer
0
219
Member Avatar for musikluver4

How do I allow the display to show numbers with the commas, but then when it does the calculations, have the commas go away for the math since obviously java can't read commas in calculations? example [CODE] DecimalFormat df0 = new DecimalFormat("###,###.00"); JFormattedTextField loanText = new JFormattedTextField(df0);[/CODE] the user puts …

Member Avatar for JamesCherrill
0
166
Member Avatar for cac186

I am wanting to reference an object of type JTextField and convert it to JFormattedTextField. Is it possible to convert to a subclass? I tried coding something to the affect of [CODE]ClassA.object = new JFormattedTextField(); ClassA.object.setValue(new Integer(number)); [/CODE] But no success. Any suggestions?

Member Avatar for NormR1
0
133
Member Avatar for countpuchi

Okay, First and foremost im new to the forum. Hi and Thx to anyone who helps :D Anyhow, i would like to ask you guys if it is possible to separate a String with tokens one by one. Then make them appear in the jTextField with only 1 word per …

Member Avatar for jon.kiparsky
0
191
Member Avatar for Ecliptical210

Hi Guys, I posted earlier, and I figured it out after a few hours of playing around with it. Now, a new question arises. Is it possible to get the input from a JTextField and add it into a JComboBox via an array? The only thing stopping me from achieving …

Member Avatar for javaAddict
0
148
Member Avatar for Shigekazu

Hello all, I'm trying to add a multiple JTextFields onto a single JPanel that has been already initialized thanks to the Design tool from the JFrame. I'm pretty sure that I already added them and I'm not getting any errors but they aren't showing up when I execute the program. …

Member Avatar for quuba
0
157

The End.