How To Hide Or Not Show Output
Aug 8, 2014
My code is already running. But the problem is, i don't want to see 0 denomination. like for example if i input 3.86 in (dollars).
dollars: 3
quarters: 3
dimes: 1
pennies: 1
so my problem is. it still showing 0 denomination like this:
dollars: 3
quarters: 3
dimes: 1
nickels: 0
pennies: 1
Currently using latest netbeans and if im correct we are using methods and class runner?.. Anyways here's the code..
for method:
package MyPrograms;
public class Mp3Method {
public int dollars(int dollars,int remainingAmount){
return dollars = remainingAmount / 100;
}
public int quarters(int quarters, int remainingAmount){
return quarters = remainingAmount / 25;
[Code] .....
View Replies
ADVERTISEMENT
Nov 23, 2014
In JButton's click event, I wanto to show a JPanel to print the message "Processing" on the screen. Before JButton's click logic end, hide the JPanel.
Actually, JPanel is not displayed. I do not know why.When msgPanel .setVisible(false); is commented out, JPanel is normally displayed .But do not know how to hide it when JButton's click logic is finished.
Here is the code.
loadBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
JPanel msgPanel = new JPanel(rootFrame);
// Show the message JPanel
[Code] .....
View Replies
View Related
May 29, 2014
I want to make project about java communication with hardware (wiz110sr) via LAN (Rj45). And for example, my hardware have ip address 198.168.0.1 ; port: 1202, connected with my PC(via lan/Rj45). I want show the output (such as numbers and letters) from my hardware in console netbeans.
When I running my code, appear :
" Exception in thread "Thread-0" java.lang.RuntimeException: Uncompilable source code
at mypkg.startListenForTCP$1.run(startListenForTCP.ja va:48)
at java.lang.Thread.run(Thread.java:745)
BUILD SUCCESSFUL (total time: 1 second) "
Here's the code :
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import sun.rmi.runtime.Log;
[Code] .....
View Replies
View Related
Apr 30, 2015
I have the following code.
class A {
List<StringBuilder> list;
public void output(List<StringBuilder> objectToOutput){
try(BufferedWriter bw = new BufferedWriter(new FileWriter("temp.txt"))){
for(StringBuilder row:objectToOutput) bw.write(row.toString());
}catch(IOException e){}
[code]....
Why don't the a's show up on the console? I put them in as part of the debugging process and now I don't understand why they don't show up in both places.
View Replies
View Related
Apr 4, 2015
Tried it, I get red line under it, tried to do "jframe1 jframe1 = new jframe1(variable);
jframe1.setVisible(False); still failed. all I want to do is open a different jframe which I got that to work but cant hide show me how to do it without having to emend my code I want to be able to do is in same style.
CashPaybtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//System.out.println("CashPaybtn.actionPerformed, event="+evt);
//TODO add your code for CashPaybtn.actionPerformed
//PaymentMethod.setVisible(false);
[Code]...
View Replies
View Related
Aug 1, 2014
Hiding the column but not removing , because i need to bring this column id to the next screen, only i do not want to show the column but internally it has to take the value to navigate the screen, but if i use below code, i am getting null pointer exception,
this.column.setMinWidth(0);column.setMaxWidth(0); column.setWidth(0); column.setPreferredWidth(0)
View Replies
View Related
Jul 25, 2014
Cannot switch on a value of type Object. Only convertible int values, strings or enum variables are permitted
I'm trying to hide and option using switch statement but this is the error i receive.
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == comboDest1)
{
switch(comboDest1.getSelectedItem())
[Code] .....
View Replies
View Related
Mar 27, 2014
I have eight panels that are one above the other and are the full width of the frame.
I would like to hide some of them some of the time and then "bring them back".
If I use panel1.setVisible(false) panel1 will disappear but then all the panels below it move up to take panel1's place.
I don't want that to happen. I want just a blank area where panel1 was.
Is there a way to do that?
View Replies
View Related
Jul 24, 2014
I'm trying to hide a JComboBox option depending if the a user has picked a certain option from a previous JComboBox.
.setVisible(false). doesn't work
String[] Dest = new String[] {"Select Destination","Crete", "Paris", "Croatia"};
String[] Accomodation = new String[] {"Select your Accomodation","Hotel", "Villa", "Bed & Breakfast","Youth Hostel"};
String[] Night = new String[] {" Select number of Nights", "7","10","14"};
final JComboBox<String> comboDest1 = new JComboBox<String>(Dest);
[Code] ....
I know setVisible isn't the way it's done but i don't know how to do it
View Replies
View Related
Jan 26, 2015
I've made a login system with a username and a password. The password is visible and I wanna hide it, how do I do that? Here is my code (have used swing);
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Password implements ActionListener {
private String Username = "hudhud";
private String Password = "fitness";
[Code] ......
View Replies
View Related
Mar 8, 2014
I am using jsf with richfaces. Scroll bar inside panel grid is displayed. Need to disable / hide the bowser (IE-9) scroll bar.
style="overflow:hidden"
Added above style, but not working.
View Replies
View Related
May 18, 2014
I have a login window, which when sucessful will activate a new Applet/JFrame. The problem is that the login window remains in the background under the new JFrame. I want this to diappear. I want to either set the visibility to false, or close it.This is how the new window is started:
if(sucess.equals("flase")){
DBAccess dba = new DBAccess();
dba.setFname(fnameusr); //fnameusr
dba.setLname(lnameusr); //lnameusr
dba.main(null);
//LogIn.exit(0);
}else{
JOptionPane.showMessageDialog(null, "Your credentials were not entered correctly or you may not be authorised to access this system.");
System.exit(0);
}
View Replies
View Related
Feb 6, 2015
I am trying to do a rock, paper, scissors game, but when i choose for example, it shows what i have typed. So how do i hide text form showing in the console?
View Replies
View Related
Sep 10, 2014
As below code showing that you cannot directly access the private variable as i understood,
public class EncapsulationDemo{ private int ssn;
private String empName; private int empAge; //Getter and Setter methods
public int getEmpSSN(){ return ssn; }
public String getEmpName(){ return empName;
[Code] .....
View Replies
View Related
Feb 9, 2014
I am generating pdf and displaying it in separate window/tab using the approach described in BalusC Code: PDF handling.I need to display blockui ajax loader when i select the commandlink to display pdf.The pdf gets generated but the ajax loader image remains as it is.I need to manually refresh the page to hide it.Is there any way using which it can be hidden as soon as the pdf gets displayed.My code snippet is as below
JSF page
<h:form id="subFrm">
<p:commandLink value="Download PDF" action="#{pdfBean.downloadPDF}"
onclick="blkUi.show()" oncomplete="blkUi.hide()" id="cmdLink"
ajax="false" />
[code]....
View Replies
View Related
Jun 25, 2014
I've a simple status bar in which I've several icons inside a HBox (ui drawn with fxml). These icons can be visibile or hidden due to some configuration properties in my app. I've a bind between some BooleanProperty and image.visibleProperty. The problem, as you can guess, is that when an icon in the middle disappears I've a hole. There is a property as in Android [URL] ...., that hide the node and collapse its space?
View Replies
View Related
Aug 1, 2014
How do i hide a specific column in a JTable object.? Setting setPreferredSize to 0 is not working.
View Replies
View Related
May 15, 2014
I put link using JQuery on Home Page,
<div class="list_block1" >
script type="text/javascript" src="js/jquery.leanModal.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/postoffer.css" media="all"/>
<div class="container">
<a id="modal_trigger" href="#modal" class="btn">Click here to Login or register</a>
<%
[Code] ....
View Replies
View Related
Dec 9, 2014
There are 8 JCheckboxes, which are already added to panel and aligned in group layout. From which, I have selected one JCheckbox. Then the resultant GUI should contain only remaining 7 JCheckboxes and selected one should temporarily removed or hide from GUI . Is it possible? If so, how?
View Replies
View Related
Oct 28, 2014
I am maintaining an existing Java product (which has a HUGE code-base). I discovered that it is setting (and getting) two of its internal passwords as Java system properties, at no less than 4-5 different places (methods). Now, the problem is, the passwords are being stored as plain text in the Java system properties, and so, the same is visible to external entities, as the application is not using any Java Security Manager. For example, if the application (process) is running on port number 1234, we can run the Java command:
jinfo -sysprops 1234
to view both the passwords as values of the corresponding Java system properties. I wish to ask if there is any remedy to this without changing the existing code-base too much? The desired effect would be to "hide" the two Java system properties (denoting the two passwords) from all external entities.
It may be noted that introducing a Java Security Manager into the application may not be a solution, as if we revoke read permissions from the said two Java system properties using the Java Security Manager, the application codes which read those properties would crash. Same is applicable for storing the passwords in encrypted form, as that would crash all codes within the application which are expecting to read the passwords in clear text form.
To give a bit more context, the said two passwords we are storing as Java system properties are actually passwords to access two key-stores, and Tomcat requires that we store the said two passwords in plain-text format. Any workarounds, such that only Tomcat will be able to see the two passwords as-is, while they will be invisible to all other external entities?
Or, is there any way to place the said passwords in other in-memory locations (like static variables) which only Tomcat can (be made to) read instead of placing them as system properties which is exposed to anyone?
View Replies
View Related
Mar 11, 2014
How do i make the 'date' column show only the date and 'timeIn' and 'timeOut' column only show the time. In my database table my 'date' column is a date type and 'timeIn' and 'timeOut' column is time.
View Replies
View Related
Feb 15, 2015
my output fails to display me the 2nd output.Here's my code.
import java.util.Scanner;
public class year
{
public static void main (String [] args)
{
Scanner console = new Scanner (System.in);
System.out.print("Enter the choice of book(A-ABC,D-EFG):");
String x = console.next();
System.out.print("Enter the rate (1-3):");
int y= console.nextInt();
System.out.print("Enter number of kids reading:");
int k = console.nextInt();
[code]....
When I key '0" for kids, it did not appear the second print out. I don't want the first print out to be the output.
View Replies
View Related
Dec 3, 2014
I want to make app in netbeans. When i write numbers in JTextField like 1,2,3,4,5,6... it should show me in JOptionPane information window result of ODD numbers.
View Replies
View Related
May 8, 2015
I want my program to show 1st panel and when a person press image label 2nd panel showup which will have 2 tabs "oneway" and "round trip". But rightnow I only see 2nd panel with only 1 tab and don't see 1st panel at all.
import java.awt.*;
import static java.awt.Font.BOLD;
import java.awt.event.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.*;
import javax.swing.Timer;
import javax.swing.border.*;
import javax.swing.event.*;
[code]....
View Replies
View Related
Nov 25, 2014
This code models a simple ATM machine that can deposit, withdraw, and show the 10 latest transactions in an array of 10 index values.
My problem is that I can't get the balance right after 10 deposits, the balance only seems to sum the values in my array, not including the transactions made before those ten.
import java.util.Scanner;
public class cashier2 {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int amount = 0;
[Code] ....
View Replies
View Related
Aug 3, 2014
The PNG Image is already in the src package thingie...
It's a 400 * 258 image...
Java Code: package frame;
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
public class Temperature_Convert extends Applet
implements AdjustmentListener {
private Image temp;
private Scrollbar bar;
[code]....
View Replies
View Related