I am getting data from user and checking it with database (MS SQL ) if it fits it is switching to new window. In new window I need to use again my database so I need to add connecting data again. I would like to get them from login window. How to do that? I know theory but when I am writing code nothing works. Here is working code for login panel :
/*import java.awt.BorderLayout;
import javax.swing.*;
public class Login extends JFrame {
I am getting datas from user and checking it with database (MS SQL ) if it fits it is sweatching to new window. In new window I need to use again my database so I need to add connecting datas again. I would like to get them from login window. How to do that? I know theory but when I am writting code nothing works. Here is working code for login panel :
/*import java.awt.BorderLayout; import javax.swing.*; public class Login extends JFrame { public String url; public static void main(String[] args) { Log frameTabel = new Log();
I have write a SSO class for Single Sign on But i am getting one issue i am using JSF2 for my web application...here is my SSO class :
public class ApplicationSSO implements SSO { public String authenticateUser(RequestContext request) { UmUsersList user = (UmUsersList) request.getSessionContext().getAttribute("USER"); return user.getUmulEmailId(); }
[Code] .....
As you can see i have write below line
JSFUtils.redirectPage("../login/Login.xhtml");
It mean if User null it will redirect to Login page but it is not working. How to solve the issue i am end up with
An error has occurred.
For detailed error information, please see the HTML source code, and contact the forum Administrator.
Error while executing SSO actions: java.lang.NullPointerException
I have a JPanel class that creates a left panel and a right panel. the left panel and right panel both have one button each. What I’m trying to accomplish is when I click on the button in the left panel that it updates the button in the right panel. I have to do this without changing anything in the right panel.Basically I have to have LeftPanel have a way to keep track of an instance of RightPanel and I would have to do this through the JPanel class. But I have no clue where to begin on even accomplishing this.
I have this panel in a nested class in the MainPanel class and it does not display, when I launch the applet, or more like, the two menus "LineColor" and "BackColor" from the nested class ColorPanel do not display .
When i click on the button from bottom panel, top panel need to be redrawn. But redrawing is not happening. It happens only when resizing the applet.
public class Graphics_Chart(){ public init(){ JScrollPane topPane = new JScrollPane(new ImagePanel2()); topPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); topPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
I need to store the data of a bunch of objects of a particular class in files in a predefined directory. Later, I want to get all the files from the directory and turn them into the objects again. Ideally, I'd like to have one file per object and have the files be human-readable and editable without too much difficulty. The class used by the objects will likely be subject to change in the future, as well. To keep things simple, all the data members are either primitives, Strings, or arrays of them. What is the best library/API to use to deal with this situation? Or should I write my own classes for these operations?
I read into serialization, but I read that it doesn't deal well with classes that are frequently modified. I also found articles on Preferences, but none of the ones I saw seem to explain how to best handle reading and writing to and from multiple objects, especially when I don't know a prior all the objects that were written to disk.
I've been unable to figure out how to access an objects data from another class. I ended up missing a lesson in java and haven't been able to catch up on this topic on my own through my textbook.
Error: has private access
Code:
public class TestCoffeeDrinker { public static void main(String[] args) { Coffee latte = new Coffee("Starbucks Tall Latte", 2.85); Coffee mocha = new Coffee("Starbucks Grande Mocha", 3.95); Coffee mcdonalds = new Coffee("McDonalds McCafe", 0.99); System.out.println(mcdonalds.toString());
I have been asked to write a program with 3 classes(an interface, a store and a product class) and I have been going ok until I need to display data on the interface that is held in the product class. At the moment the code will compile fine but when I run the program and try to use the writeOutput() method I get a stack overflow error.
I realise now that it is because of a non-terminating recursive call, however I can not think of a solution on how to fix the problem. And just to clarify, what I am aiming to do is have the MatesTerminal class display the data for name that is stored in the Product class(I have no way of determining which product to display at this time, so I would like to be able to display the data for all three products if possible). Anyway this is what I have so far:
The method from the MatesTerminal Class:
private void writeOutput() { int productChoice; Scanner console = new Scanner(System.in);
I have problem with this applet. the browser gives page.I don't know wether its not loading or if its extremely slow.Also I am confused on the html part.Should I use tag object or applet and for entering class name data,classid or name.
import java.lang.reflect.InvocationTargetException; public class NewJApplet extends javax.swing.JApplet { @Override public void init() { this.add(fesText); this.add(jButton1); this.add(jLabel1); this.add(jLabel2); this.add(jPanel1);
I am trying to create a second class in a single java file (first time trying this) and want to use data from the first class in the second class but I am not able to do it. What am I missing :
package simplecommissioncalculation; import java.util.Scanner; // import java.util.Scanner public class SimpleCommissionCalculation { public static void main(String[] args) {
<FileDownloadActionListener> <processAction> javax.el.ELException: java.lang.OutOfMemoryError: Java heap space at com.sun.el.parser.AstValue.invoke(Unknown Source) at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
I'm trying to share an hashmap(or any other stuff to share data) between a java class and a servlet. The hashmap has to be filled into the servlet with some data and then I have to get those data from the java class.
What is the best approach? I cannot use a DTO because I have several concurrent requests to my servlet.
I've been trying to pull data from another class file "Calculations.java" and have it be displayed in a TextField in "DataAnalyzerGUI.java". Here is how the hierarchy is broken down for my assignment:
Your Tester class main method must use an array or an ArrayList of Person objects. It must be populated from a text data file, friends_data.txt. Add the following data to your text file,
Michelle, 12/20/2008, Camilla Bryan, 3/8/2007, Tom Camilla, 6/7/2005, Michelle Tom, 10/15/2007, Bryan Charlotte, 3/2/2008, Michelle
Each line has the meaning:
-Person name, Person date of birth (MM/DD/YYYY), name of best friend -Write a Java program that reads in the data from the friends_data.txt file, allocates a new -Person for each and then stores the newly created object in either an Array or an ArrayList. -Next print out a report showing the following information for each Person,
1. The Person's name 2. Their popularity counter 3. Their age on May 1, 2014 4. The name of their best friend 5. The age of their best friend on May 1, 2014
Finally, print the name of the most popular Person and the name of the oldest Person.
Person Class
import java.util.ArrayList; public class Person { public String personsName; public String personsFriend; public String personsBirthday; public int personsPopularity; public int popularity = 0;
"method getPopularityNumber in class Person cannot be applied to given type: Required: java.lang.String[]; found: no arguments; reason: actual and formal argument lists differ in length.
**Getting data on from rfid scanner as Serial rs232 port in JFrame**, in this case I have made a JFrame form and I have a JTextField for storing data rfid as a String. Actually, I found a class from internet that read the RFID reader as byte, now How To get data from my RFID Class to my JTextfield Jframe in my main class as String?
Okay, I am supposed to implement the functionalities of the Set class using a private data member of type ListReferencedBased<E>,how the ListReferenceBased works with what I am trying to accomplish.I am trying to complete Set.java, and I have barely started and much of the code doesn't work. ListReferenceBased was given to me completed.
import java.util.Iterator; pubic class ListReferenceBased<E> implements ListInterface<E>, Iterable<E>{ /** reference to the first element of the list */ private Node<E> head; /** number of items in list */ private int numItems;
I have a string of variable tags (tag) filled with variables, and using a Scanner (scan) to manipulate and generate data dictionary add cards for each. The variables are delimited with new line character, and the variables are structured such that the actual name of the variable contains info as to its data type, size, etc. What I need to do is move the scanner to a particular point into the string then use .nextInt() or similar. I don't want to do this to the whole variable, just where I start it from. How can I do this?
Scanner scan = new Scanner( tag ); int ptr = tag.indexOf( "_" ); ptr++; if ( Character.toLowerCase( tag.charAt( ptr ) ) == 's' ) // then start at the "_" character and grab the nextInt()
I have a secured Struts application in WebSphere that uses FORM j_security_check for authentication.There is also a Post Logon "filter" defined which runs some code after a login is processed.The extract from web.xml showing the login configuration and filter is as follows:
If a user isn't logged into the application and they try to access one of the secured servlets, for example quotes.do, they are directed to the login page to enter their information.If they login successfully, they are then directed to quotes.do, rather than the default "welcome" page. Is there a setting in the web.xml or the post logon filter where I can force j_security_check to ALWAYS go to the default welcome page after a successful login?
Today downloaded eclipse and for the database i installed MSSQL 2008 R2. I want to make a webpage where i started with the login credentials, how to make a webpage for the login credentials?
I need two boxes
ID: Password: [Submit Button]
how to make a webpage and how can i run locally should i install IIS?
example: i hava a table conex wich i inser on it two columns name and password i fill it by name : yosra password : lol name : najeh password :mdr
i don't know when i fill jTextfield of password and name correctly for ewp i put yosra as name and password as lol the loop continue to the next row and i show the two message dialog on netbeans about correct acces and refused access and the frame of my chatroom is opened
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) { // TODO add your handling code here: String pass=new String(this.pass.getPassword()); String nam=this.name.getText(); acceder(nam,pass);