Comboboxes Lock On To Each Other
Feb 22, 2014
My code is long so I will try to explain this. I have a GUI application which gets two dates from a user via multiple combo boxes (month/day/year for each, so 6 total). The assembly and processing of these dates (including the days changing based on the month) is correct.
That said, however, when interacting with the program and changing the dates back-and-fourth on the frame, the 'days' combo boxes occasionally lock to one another. For instance, if you select 5 in one, 5 mimics in the other and this cannot be undone.
These are the last relevant bits I believe before the 'SUBMIT' button is clicked and it is all processed.
Controller ... (same set-up for the departure date)
Java Code:
// MONTH COMBO BOX LISTENER -- ARRIVAL
class ArriveCBListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
// Arrive Dates
[Code] .....
View Replies
Sep 11, 2014
I have a class that extends JFrame, within that, i have set up JPanel where within that i have four JComboBoxes, I am to enable this JPanel and its JComboBoxes at the end of a method
The code for that method is:
private void tableNumberJComboBoxItemStateChanged() {
// load data for table
try {
// get data for table
myResultSet = myStatement.executeQuery("SELECT * FROM"
+ "restauranttables WHERE tableNumber = " + Integer.parseInt(
selectedTableNumber));
[Code] ....
I am not sure how to enable this JPanel? I have another Jpanel to Disable but one question at a time i suppose.
View Replies
View Related
Jul 25, 2014
ConcurrentHashMap can be used in Readwrite Lock..
View Replies
View Related
Apr 18, 2014
I'm suppose to read the following code and devise a program that can break the lock.
public class InsecurePasswordLock {
private char[] secret;
private boolean unlocked;
public InsecurePasswordLock() {
// secrets are usually 30 to 50 upper case characters long
// but here's a hard coded example one
secret = "ASECRETTHATYOUWILLNOTGUESSTODAY".toCharArray();
[Code]....
So, I believe that I can try various password lengths until I get a return from open that !=-1. But I'm not sure how to implement this. This is what I have so far to get the length:
public char[] breakLock(InsecurePasswordLock lock) {
int checkCount=1;
int length=0;
while(checkCount!=-1){
for(int i=0;i<=25;i++){
char[] key = new char[i];
if(InsecurePasswordLock.open(key)!=-1){ // I get a fault at this line for calling a static method
length=i;
checkCount=-1;
}
}
}
I get the error:
Cannot make a static reference to the non-static method open(char[]) from the type InsecurePasswordLock..
How can I keep querying the open method to get my length??
View Replies
View Related
Mar 10, 2014
Which methods can be used to lock keyboard and mouse inputs using java??
View Replies
View Related
Jan 5, 2015
how can I provide a lock to a CSV file while creating the CSV file using java application and how to restrict the user to open CSV file manually instead of opening the file using java application(Swings and Hibernate). That means instead of opening the file manually the user has to use java application to open that CSV file.
View Replies
View Related
Oct 23, 2014
I need to use a counter to keep track of user's input. In this class I am trying to create a combination lock that takes three strings. In the tester class the user inserts three strings and both are compared to see if users input matches correct combination. I have no errors only problem is the setPosition method. My output is always false.
public class CombinationLock {
private String first;
private String second;
private String third;
private String firstGuess;
private String secondGuess;
private String thirdGuess;
private boolean open;
private int counter;
[code]....
View Replies
View Related
Feb 8, 2014
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
public class tree_lock_test{
int total_instances;
int thread_instances = 0;
int N;
[Code] .....
this is compiled with another Peterson class which has implemeted peterson lock for two threads ...
View Replies
View Related