Eclipse generate many JFormattedTextField - user-interface

I implemented Gauss Jordan Algorithm in eclipse and now I am trying to make it be a software, however I have no experience at all with GUI.
I have a window that asks for input of 2 things number of variables and number of equations and when user enters the numbers and presses submit button, second window opens.
In that second window I need certain number of textfields to appear itself, which will be dependent on the two variables mentioned above.
My question is there any way to grab the value from first class(first window where user entered variables which I stores in first class) pass it to second one(second window where the textfields will appear) to tell it how many rows and columns should be generated with textfields and then the program would generate it?
I tried looking up on youtube, because I do not understand documentations well, so any answer would be very appreciated!

Well the MVC pattern could help you to do this, check something like this:
http://www.austintek.com/mvc/

Related

CPropertySheet: How to get the child page from OnDrawItem

I've added some code as found here Big problems with MFC/WinAPI to colour tab titles the same as the reset of the dialog, which works, but unfortunately all the tabs end up with the same name. This doesn't surprise me all that much as GetCurSel() is used to grab the text to use, and only one tab can currently be selected, but I'm struggling to see how you access the correct tab index from OnDrawItem().
I've googled and had a look on MSDN but don't see how anything passed to OnDrawItem lets you know which tab is currently being drawn, rather all the examples I've seen assume you're only interested in the one currently selected. All I want to do is something along the lines of GetWindowText() on the child window and redraw with that. I'm also unsure of the parent/child/sibling relationship between the sheet, tab control and page - it depends who you listen to.
I should probably add that I'm also unsure why all the tabs are redrawn when I select one. I don't know if this is normal or something specific to this implementation (that's something I'm looking at, but like seemingly everything else in this code base it's multiply inherited several times over ...).
Cheers for any help.
Not to worry, I now realise lpDrawItemStruct->itemID holds the tab index so I can get a handle to the tab using that.

NSSwitchButton alternatives

I am writing a Mac application that provides a "test" like function. This application (through a connection with a server). Basically the application will give the students a story to read, followed by a series of questions (also from the server) where the user can (attempt) to select the correct answers, and send the result back to the server to be verified.
Implementing the "story" part was easy. Just send all of the text to a NSTextView. I had been planning to implement the "select your answer" as programmatically created NSSwitchButtons. However, some of the possible answers might take up more than one line. I have not been able get (any) NSButton class to wrap text based on the frame size, and there doesn't seem to be an easy way to override NSButtonCell to allow the text to wrap.
What other Cocoa class(es) should I use to accomplish this task? I need to have a check-box interface (so that people can select one or more possible answers, and the answers can be an arbitrary length - within reason!) Ideally it would also be easy to use so that it will be easy to programatically layout the answers as well. (Some problems may only have 2 choices, while others may have 5+) I can't imagine I'm the only one who needs this type of functionality
(Oh...since a picture is worth 1,000 words, I've attached a screen-shot of my app below with some answer text running off of the screen)
An NSButton will respect explicit linefeed characters embedded in the text, but I suppose that would not meet your needs. An alternative would be to have a static text item next to a checkbox with no title. Of course, if you want to be able to toggle the checkbox by clicking the text, you would have a little more programming to do.

MATLAB: How to present multiple images/figures to user and wait for click on one of them?

all. I'm new to Matlab and I'm a bit stuck. The last piece of the puzzle to run my experiment is to get some human input (expert supervised system). As easy as this may sound, I just can't seem to figure this one out.
I need to display four images to the user, plus an additional fifth figure (button, or could even be another image, doesn't matter). The code should wait until the user clicks any one of those images/figures and should continue afterwards (closing the figures, too). Obviously, I'd need to know which figure was clicked.
GUI programming in Matlab doesn't seem to be documented clearly to me. Or perhaps it's just in a realm that I'm not talented with. It's definitely a lot more confusing than Visual Studio, that's for sure.
Thanks in advance for your time; I greatly appreciate it! :)
Could you make all five of the images into buttons? The 'CData' property of a button can be used to display an image on a MATLAB button. See the following links for an example and an explanation (that hopefully makes sense!).
http://www.mathworks.com/matlabcentral/fileexchange/2378-buttons/content/buttons.m
http://www.mathworks.com/support/solutions/en/data/1-16V03/
Use menu:
figure(1)
plot...
figure(2)
plot...
figure(3)
plot...
figure(4)
plot...
% this will create a menu of labeled buttons where the user can click
m = menu('Choose a figure','Figure 1','Figure 2','Figure 3','Figure 4','None');
% close all 4 figures
close(1:4) %will close figures 1 to 4
% --------- your program from here on ---------
if m == 5
display('You chose no Figure');
else
display(['You chose Figure:' num2str(m)]);
end
%---------
menu will return a number which corresponds to the option that the user clicked on.

Ajax-like appearing/disappearing elements in Access 2010 web database project

I'm trying to have a feature to allow users choose two different methods of cost calculation: either they can enter a yearly cost breakdown on a datasheet (2010: $10,000, 2011: $12,000, etc) or they can enter a flat yearly cost multiplied by the number of years they select.
If I were developing another kind of web application, I'd have radio buttons to select two different options. One option would display the datasheet, and the other option would display two text fields to enter values into. However, I understand that you can't have radio buttons in Access 2010 web databases. Also, is it possible to make elements appear and disappear based on a combo box selection?
If not, perhaps I could have two different combo box options: "enter yearly cost breakdown"
or "enter flat yearly cost," which open the correct respective forms as pop-ups.
So, 1) can I have Ajax-like appearing and disappearing elements as triggered by a combo box (or ideally, radio buttons), and 2) if not, can anyone think of another clever way of doing it?
Sure, you get a nice effect by using a tab control. You can place controls and even a sub form on that tab control.
So, you build a screen like this:
Then, simple set the visible property of the second tab = No. This will hide the tab (don't change this until you built the page since it will hide it! (use property sheet to hide/un-hide during development).
Now, add some code to the after update event of the list box. Like this:
In the above, I have named the tabs PYear and PFlat.
The result is this (this is a animated gif I inserted):
Of course, you really probably could just dump the whole "list box" selection, and use a screen like this with the tabs (tabs are good UI, and users tend to grasp them quick):
So, you can hide a "set" of controls, and it really far less work and hassle then writing a bunch of JaveScript anyway. As noted, the "set" of controls you drop into each of the tabs can be sub forms, and also that of continues forms. So, the "hiding" as a set does work well in this case. I did have some format issues and found that I had to "start out" with the 2nd tab dispaled first (the first one being hidden). As noted, the listbox selecting is nice, but one could likly just go with using tabs in the first place.

looking for (N) steps GUI kind of thing

i dont sure if this question is for this group but i don't know where to ask
im looking for GUI examples that gives the user for example make X in 4 steps
kind of GUI especial for none teachi folks
Do you mean like a Dialog Wizard type interface?
The idea of a wizard is you have a single window where you can step through a number of frames containing different selections using a next button and a back button to go back and change selections? Sometimes you have a finish button to use the default selections on the remaining frames.
What language and GUI toolkit are you using???

Resources