Second frame's panel after some work must return to parent frame's panel some responds - jframe

I try to implement a create account frame with 3 options.
First JButton: login user. it opens a new frame and prompts user to login.
Second JButton: create new user.
Third JButton Make order.
Every time you press a button a new JFrame opens and you do your work.
I can't find a way to make second Frame get some respond to first Frame.
For example, to return an object that i will use it to make third JButton visible, and to let user make an order.

I solved my problem using this thread: "Managing parent frame from child frame on java swing"
thanks for your responses!

Related

GWT buttons not responsive after RequestBuilder callback

GWT 2.5.1; using Eclipse 4.2 with GPE;
UI specified with UiBinder
The app puts up a splash screen containing a "Go" button. That button's click handler does various initialization, including hiding itself and showing three other buttons, images, and text; it also initiates a server request (XMLHttpRequest) via a RequestBuilder. The RequestBuilder callback uses the returned server data to draw a bar graph in a canvas element.
After I click the "Go" button the browser window looks as expected with all the visual elements mentioned above. But the three buttons are not responsive to clicks. Not only are their handlers not invoked, they don't show the slight visual indication of activation when the mouse is clicked on them. The browser is not frozen; e.g., if the window is resized the app's resize handler is called.
Based on logging: after the "Go" button handler returns the RequestBuilder callback executes; then "nothing happens" i.e., there are no more log outputs (unless I resize the window).
FWIW this is my first GWT endeavor.
By experiment, I found a partial answer. The three non-responsive buttons are declared in the ui.xml file with {style.hidden} referring to a visibility:hidden attribute in my .css. In the java code I unhide these buttons with:
protected void showElement(Element e) {
e.removeClassName(style.hidden());
}
Evidently starting life as hidden and then shown this way is insufficient to activate the buttons. I am about to go off to research why this is so, but an answer to this "smaller" question is still welcome as long as I've not posted a comment indicating that I am less ignorant.
(too long for a comment)
I have just discovered that the problem relates to the fact that I have buttons in the same position, of which only certain ones are supposed to be visible at a given time. In other words, the user would see at the same position on the page one of:
ButtonA ButtonB ButtonC
or
ButtonD ButtonE ButtonF
or
BigButtonG (as wide either of the preceding groups)
The problem is that regardless of visibility, whichever of the three above displays is declared last has (in effect) a higher z-index and is the only one that will be mouse-responsive. So I am just about to implement a solution of explicitly setting div z-indexes in the code which shows/hides button groups.
Can you set the button's positions in your UiBinder file rather than in your Java code? Place them in a HorizontalPanel and they'll be spaced automatically.
And rather than interacting at the Element level to hide a button, instead call your button instance with setVisible(true); e.g., buttonA.setVisible(true)

How can I display a dialog canvas in Oracle Forms Builder?

I have built a form in which the user can view multiple rows of data pulled from a table. The user has the option to select a row, then pressing a button to reject the data in that row, (to be marked as rejected in some STATUS field).
I have also designed a rejection confirmation dialog with the ability for the user to enter some comments or reason for rejection.
I have set up the dialog canvas to appear on its own window with the Type proeperty set to Dialog.
When the user selects a row to reject, here is the code that gets executed:
BEGIN
GO_BLOCK('BLK_ALL_RECORDS');
FIRST_RECORD;
IF :FRM_ALL_ROWS.CHK_SELECT = 1 THEN
:FRM_REJECTION.ID := :FRM_ALL_ROWS.ID;
GO_BLOCK('BLK_REJECTION');
SHOW_VIEW('CNV_REJECTION');
EXIT;
ELSE
NEXT_RECORD;
END IF;
END;
And the rejection form has two buttons, one to confirm and one to cancel. Let's just focus on the cancel button for now. Here is the code that is executed once the Cancel button is pressed:
:BLK_ALL_ROWS.CHK_SELECT := 0; /* Forces removal of the check mark */
GO_BLOCK('BLK_ALL_RECORDS');
HIDE_VIEW('CNV_REJECTION');
The only problem is : once the dialog form appears, it hides the parent form, until the form is dismissed. How can display the dialog form ontop of the parent form with both of them visible (in a modal way?)
The navigation between different canvases can be little bit tricky to get to work. Hard to say what is the problem with not having the form in front of me but the first thing I should do is making sure that the 'Raise on entry' canvas property of the 'main' canvas is set to 'Yes'. This should force this canvas to be displayed when you are moving the cursor back to block 'BLK_ALL_RECORDS'.
Another alternative could be to use SHOW_VIEW() in the cancel dialog logic to force the main canvas to be displayed.
I found out what was the problem finally.
The parent Window had a property [Hide On Exit] which is defaulted to Yes and that made the parent form disappear everytime another window is on display. I set it to NO and called the other form. This time both windows are visible, with the modal one always on top.

Stop program until user clicks button

In my main program, I create a JFrame with a button on it. This acts as a separate dialog box that prompts the user for information. What I would like, is when the dialog box appears, is for the program to stop running until the user clicks the button.
If I just create the JFrame normally, the program will move on in the code and do other statements before information is received from the dialog box. This is an issue, because later on in the code another JFrame is created using information from the first.
Separate out the logic of displaying the frame from actions that happen after the button is pushed. What I mean is you should add an Action Listener to the Button you have, and put the code inside the its method instead of the main program. The problem is you are visualizing the solution in a procedural oriented way. Think Object Oriented.

Parent-Child Window Interaction GWT

There is parent window, which has a Panel. When user clicks on a button from parent window then a popup opens up. On popup user populates some fields and clicks on OK button then a new row should be created on parent window's panel and set values from popup window and close it.
Any Idea how to do this in GWT? Please post some example if you have. Thanks in advance for your help.
You must create a class representing the Popup and add a field to it referencing the Parent Window. In the constructor of the Popup, you pass the Parent Window as a parameter. When the user clicks ok in the popup, you call the PArent window and ask it to add a row via a method present in the ParentWindow

Force Titanium (iPhone) navigation group window to refresh

I am developing a data-driven application for iPhone using Appceleartor Titanium engine.
To cut it short, I have one window with first_name variable (label) on it and a button.
You click on the button, it bring you to the second window (through navigation group). ANd in this second window you can change the first_name variable.
So the question is, as the user click "Back" Button to go back to the first window in the navigation group, how do I reflect the first_name variable change?
(The first_name variable is just an abstract, the actual data change is actually a lot bigger, and it usually is not one window after another but could drill down to 4, 5 different windows)
eventListener. add in the first window something like
window0.addEventListener('refreshLabel',function(e){
label.text = e.value;
});
and in the second window fire the event
button.addEventListener('click',function(e){
window0.fireEvent('refreshLabel',{value:"myNewContent"});
};
You can put an event listener on the label and fire an update when the contents should he changed.
You can create an update method for the label and place it in the gloval namespace making it available to he called from the othe window.