When I long click item in the list nothing happens. I get no errors at all and I believe that either I put the code in the wrong place or I missed something else that stops Dialog from starting.
I'm having problems with using the h:inputFile tag with JSF 2.2 and Glassfish 4.0 on Eclipse. The file uploads work when the enctype is set to "multipart/form-data" in the h:form tag, but AJAX will not work. When I leave out the encType (defaults to "application/x-www-form-urlencoded") AJAX works but the uploads do not work, and in fact Glassfish crashes and generates the message:
The request content-type is not a multipart/form-data
Likewise I'm having the same problems with the PrimeFaces file upload tag p:fileUpload. In a JSF 2.0 it works correctly, but with JSF 2.2 it's giving the same problems and generates the message above.
When I start up Eclipse it tells me that Mojarra 2.2.0 is installed. Is this the source of the problem, and if so, how do I install a later version of Mojarra?
I have datatable with live scrolling enabled.The columns are not getting sorted fully.When one of the columns is sorted,for example "insured" in the image shown below, all the records seem to have sorted but when i reach the end of scroll and next set of records get loaded i see other records in unsorted order as indicated in the image ,when i try to see the column in descending order.So because of this i am not getting the sorting feature accurately done(All records are not getting sorted at a single stretch)
I am adding my shopping cart in session like bellow in servlet
HttpSession session = request.getSession(); session.setMaxInactiveInterval(60*30); // 30 minutes if (session.getAttribute("cart") == null){ session.setAttribute("cart", new ShoppingCart()); } cart = session.getAttribute("cart");
I seems if more than one person accesses it from server, if they items in the shopping cart, all the product is added to a single session. I mean if i added 4 items first and other person adds 2 items, second person sees 6 products in his cart. Where am I going wrong?
Object in my main class, it doesn't work as its supposed to. I might be implementing it wrong.
Java Code:
public PostOrderIterator<E> implements Iterator<E>{ Deque<BNode<E>> somestack = new LinkedList<BNode<E>>(); BNode<E> position; public POIterator(BNode<E>root){ somestack = new LinkedList<BNode<E>>(); somestack.push(root);}
I am developing an application to share my client screen with server, it is working well on swing. But i want to develop as web application, i am trying to using applet. But i am facing the fallowing problem..,
1) The Applet screen also open and project also running well on server mechine. But unable to see the client screen on the server.
2) The problem may be to display the JDesktopPane or JInternalFrame.
My working Server Code extends withe JFrame..Java Code:
The program runs well , it adds the applet but it dosn't update the interface unless I press "_"(Minimize) . To be more clear , the object paints a spring wich goes through 4 stages , it is added to the JFrame but it dosn't uptade until I minimize the frame , that is when it goes to the next stage .
The main class which calls the spring to be added to the frame :
public class principal implements ActionListener ,Runnable{ JTextField field; JFrame frame; private class Action implements ActionListener { public void actionPerformed(ActionEvent event) { frame.repaint();
my validAccounts array will not fill properly and has a null value in it.I added a print statement that prints the contents of the array and it is filling correctly but the very last value is null. I am supposed to be asking the user for a account number and password and it is not printing out correctly due to the fact that the array is not filled correctly.
import java.util.*; import java.io.*; public class ATM2 { public static Scanner kbd; public static final int MAXSIZE = 50002;
I have 4 Primefaces bar charts which sometimes renders, sometimes not. In one of them, I inject a http user session attribute and use it to render the chart (the idea is to show only the data that corresponds to the (logged in) user department).
There are 4 session beans which I'm using the javax.enterprise.context.RequestScoped. Sometimes, the Glassfish destroys the instance as expected, but sometimes not.Based on Exception below, how can I resolve it?
The xhtml below shows the main code for only 2 of the 4 bar charts:
<p:tab title="Horas de Treinamento (por Funci)" closable="true" > <p:barChart id="horasBars" value="#{chartHorasFunci.modelHoras}" legendPosition="ne" orientation="horizontal" seriesColors="AA5555, 00438F" xaxisLabel="Horas" yaxisLabel="Funcis" title="34 Horas de Treinamento (Orçado/Realizado) por Funci"
[Code] .....
The Exception:
SEVERE: Error Rendering View[/capacitacao/capacitacao/index.xhtml] javax.el.ELException: /WEB-INF/include/capacitacao/capacitacao/List.xhtml @145,38 value="#{chartHorasFunci.modelHoras}": org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to invoke private void br.com.bb.upb.diage.atb.capacitacao.beans.ChartHorasFunci.initialize() on br.com.bb.upb.diage.atb.capacitacao.beans.ChartHorasFunci@3e9c727c at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
I am trying to create a tree that is like a take on 21 Questions. The tree pretty much just starts with three default values: the root/first question "Is it a mammal?", a left child "is it: human?", and a right child "is it: fish?", and then it builds off from there. It goes left for YES and right for NO. If the program guesses the wrong animal the user must enter the correct answer and a question that will distinguish the correct answer and the failed answer. That new question then becomes both the the failed answer and new answers's parent.
A little visual:
....................Is it a mammal?
...........It is: human?........Is it: fish?
*lets say it is a mammal but not human, ie a dog
Updated tree:
.....................Is it a mammal?
.....Does it have a tail?............Is it: fish?
Is it: dog?......Is it: human?
My problem is that after I update the tree 3rd time the values do not change properly. Lets say it is a mammal and its does have a tail, BUT its a cat, then, the updated question, which would now go before "is it: dog?" would be something like: "does it chase rodents?", which its left child would be cat and right would be dog.
However, when my program displays the values it would go something like this:
//first run: GOOD Think of an animal and I will guess it! Is it a mammal? Enter yes or no: yes Is it: human? no
[Code] .....
So pretty much I can't understand what I'm doing wrong since the values in the print statements are right, but they are wrong during the actual run. Where is my error?
The parameter for the starting y is "fy" (Half of the screen). When I use the keys "z" and "x" it translates one pixel at a time left and right. That is good, but when I use the keys "a" and "s" it will double each time (good), but the starting y will drop significantly (bad). I tried manipulating the "x" and "fy" variables, but to no avail.
I was trying to do a short program that scans a text for a given word and then tells you how many times that word was repeated in the text. The result was this:
var text = prompt("Write the text to be searched through"); var word = prompt("Write the word to be looked for. Beware of capitals!"); var hits = []; for (var i = 0; i < text.length; i++) { if (text[i] === word[0]) {
[Code] ....
However, this doesn't scan the text properly. I think the problem lies in one of the lines from 4 to 8, but, even after thinking quite a lot, I couldn't understand what was it. I thought that by saying that the letter of the text in position [i + k] shuold be equal to the letter of the word in position [k] I could make it work, but it doesn't.
I am trying to only allow the user to input numbers. But I need to enter a number twice before it moves to the next line statement and also skips a line when i enter th number a second time.
How can I go around fixing this.
My code for this is
case 1: do{ Event event = new Event(); out.println("Please Enter the name."); event.setEvent(input.next()); input.nextLine();
I am having a problem with my program. I can't get my program to calculate properly. Everything compiles and run but its just giving me a wrong answer. I am suposse to get 115.50 but instead I am getting .30...
order.java public class Order { double salesTaxRate; //initializing a variable for the sales tax rate. double subTotal; //initializing a varliable for the sub total. double shippingCost; //initializing a variable for shipping cost. double salesTax; //initializing a variable for sales tax. double totalCost; // initializing a variable for totale cost.
My validAccounts array has a null value in it when i print it. How to do this.
I am NOT allowed to use bufferedReader or ArrayLists. This must be done with loops.
import java.util.*; import java.io.*; public class ATM2 { public static Scanner kbd; public static final int MAXSIZE = 50002; public static void main(String[] args) { kbd = new Scanner(System.in);
Have have just started working with JavaFX and SceneBuilder having been a long time Swing developer.
My first foray into the world of JavaFX involves building a rather simple desktop application to parse text based log files with regular expressions.
Currently I am working on the main window for this application. I built a scene in SceneBuilder using a BorderPane for my root.
I placed a TitledPane which contains a TableView in the center section of the BorderPane and a VBox which contains several Buttons in the right section of the BorderPane. When I view the layout in SceneBuilder using the Preview menu item to show the preview in a Window, SceneBuilder shows the scene laid out exactly as it is in the work are and as I would like it laid out.
When I close SceneBuilder and go back to my IDE (Eclipse) and build and run the application the scene is displayed in a window differently than in SceneBuilder preview. When the application executes the scene is laid out as if there has been something placed in the top section of the BorderPane, the TitledPane containing the TableView is centered in the window and the VBox containing the buttons are not aligned with the top of the TitledPane containing the TableView because it is as if there is a "null control" in the top section of the BorderPane.
Why is there a difference in the way SceneBuilder displays the scene and the way the executed application displays the scene?
Also, I recently made some changes to the layout of the controls in SceneBuilder (e.g. changed some padding and location of some controls in their containers and again the scene looks perfect in SceneBuilder but when I execute the application now some components in the container where I made the changes are truncated when the scene is displayed when the application executes.
It is almost as if SceneBuilder is interpreting the FXML one way and the JavaFX API during run time is interpreting the FXML another way.
First and second numbers are in order source and destination points.
First and second numbers in another each line represent edges. Third one is wage of each edge.
My code looks as follows:
import java.util.*; import java.io.*; class Vertex implements Comparable<Vertex> { public int name = 0; public ArrayList<Edge> adjacencies = new ArrayList<Edge>(); public double minDistance = Double.POSITIVE_INFINITY; public Vertex previous;
I was told to create a class named Billing that includes three overloaded computeBill methods for a photobook store.
The first method takes the price of the book ordered, adds 8% tax and returns the total due. The second method takes the price of the book, and the quantity, adds tax and returns the total. The final method takes the price, quantity and a coupon discount, adds tax and returns the total.
All of this I have managed fairly well, although I keep getting a strange error at the end of my program that the constructor is undefined. The problem bits of code(the one throwing the errors) are under the comment //Enter values into each of the methods
Code:
package org.CIS406.lab2;
public class Billing { //Declarations double bookPrice; int quantityOrdered; double couponValue;
[Code] ....
My first thought was to create a constructor for each of the methods that I am using...
I am working on a program that should take an input file as a command line argument and check if that file contains a valid sudoku solution. Right now the main error I am getting is my scanner isn't functioning properly and is throwing inputMismatchexceptions, but Im also not sure about the validity of my functions, and i cannot test them because my scanner isn't working.
import java.util.Scanner;
//This class will read in a possible sudoku solution and test it for validity. If it is invalid, return at least one reason why.
public class SudokuVerifier { //this function checks a row to see if it contains the numbers 1-9 public static boolean checkRow(int sudoku[][], int i) { boolean contains=false; // keeps track if the line contains a certain number for(int k=1; k<=9; k++) { //goes through every number from 1 to 9 for(int j=1; j<sudoku[i].length; j++) { //checks every element in the row to see if it is equal to k