How can I take something in then out in Eclipse? - eclipse

I have been looking for a way to pull something out of my main method into a outer method then plop the output of the outer method back into the main method (this is in Eclipse).
I have been looking for a strangely long time for a answer for this but everything seems way more advanced than what I am looking for. If anyone can help it would be a great help.

You want the extract method refactoring. Select the code block that you want move into a different method and press Shift-Ctrl-M. Or is it Ctrl-Alt-M? Can't remember right now.
And here I go giving refactorings to someone that doesn't even know what a method is....

Related

Is there a way to see the order in which functions are called when we execute a program in Xcode?

Is there a way to see the order in which functions are called when we execute a program in Xcode? For instance, at runtime, if we press a button corresponding to a certain IBAction, can we see the order of method calls thereafter? I know the debugger is available, but it seems to be particularly useful when you know exactly what method calls you are looking for.
Any help would be much appreciated!
Swift flows top to bottom. This is a good post on that. As well you can run a breakpoint, also added an explanation of a breakpoint. You can use them to stop and manually advance Xcode to the next thing to execute helps a lot with debugging.
You could also do print("Function x")
in each of the functions you have. This would then print them in order of execution time.
Swift Flow
Breakpoint Article

C# flipping mainwindow

this is my very first entry here, may it not be the last....
I am having a bit of a struggle with some GUI stuff.
I really have an animation up front my eyes and it should look like the following: using c# with desktop application.
This Form looks like a login window with server address, username and pw textboxes and with a connect button as well, so nothing special. Size wise it can be small or at least same as size as the turned window. doesnt matter at the end.
once you entered your credentials and all turns out to be fine, connection is there and valid.
The main Form is suppost to flip then (doesnt matter horizontal or vertical),
and shows you your options you got then in this newly window. kind of an animated sign, that you are logged in and have now these options.
But the flip is suppost to stay on the same place. Like a card flip or a coin flip, but just the whole form and it ends then at the same place as before.
(sounds really wired to explain)
This can also be done with a new form poping up, just with a animated turn over, no problem with that.
And this is exactly where I am stuck.
I really cant find any information on how this would look like in code or even in animation.
I am using c# and the basic project started as a desktop application project, which it will be at the end.
Its been a while since my last coding, please be gentle.
i know there are plenty of entries in here also in google as well, but i didnt found anything which will do this for the main window as a total. images etc: yes, but for the whole form: no.
Any help out there?
May be tehr eis a trick i am not aware of? Its been a while since the last coding work, I need to admit that.#greyhairsarecomming
many thanks in advance! much appreciated
kind regards TG

How do I customize a JSlider to have a larger "thumb"?

I have a Java GUI that I'm developing and I've run into a snag with regard to the default size of the "thumb" on a JSlider I need for user input for the simple and unavoidable reason that the application has to run on a touch-screen, there is no mouse, and the precision of the touch of a finger is just not good enough to make it easy to "get a grip" on the slider to move it. The touch screen is all there is... it just isn't that precise.
NO PROBLEM, I thought! I'll just customize it and make the "thumb" bigger! In doing my research I found this previously asked question, and it has what looks like helpful data, but I couldn't figure out how to get that to work. In the answers to that question it points to this page where it purports to show how it's done, but ... it then doesn't show it?!
I guess they presume you know what to do with the likes of:
Slider.thumbHeight Integer
Slider.thumbWidth Integer
But, I don't! Anybody got any code snippet of an example?
I played around, incompetently, with stuff like this that I really don't quite understand:
UIDefaults defaults = UIManager.getDefaults();
defaults.put("Slider.thumbHeight", 45);
defaults.put("Slider.thumbWidth", 15);
...With no success, though it does compile just fine. I tried creating the slider after this. Nope. I tried mySlider.updateUI(); Nope. And, of course, this won't compile at all: mySlider.thumbHeight(40); ...I just don't quite grock how one is supposed to customize these things.
Thanks in advance.
Old post I know, but still may be relevant for others anyway.
"Slider.thumbHeight Integer" just tells you that the variable is of type integer and thus expects a whole number as an argument when you set it.
You have to change the UIdefaults (as in your example) before you create the JSlider.
This said it seems to be operating system dependent whether it works or not. It worked well on my Windows10 PC but not on Raspbian Linux where I really needed it :-(

Where to Update a JFrame

Hi I have a JFrame class that I update based on information I recieve from another class. I have created an update method within the JFrame which I use to update the different objects on the page. But my Question is is that the correct thing to do?
You can make it however you want, there is no "right" way. It's all a matter of preference. Personally, I like that way of doing it. In almost all of my GUI's I have a method called "update()" or something similar.
its depends on how updates are being triggered, but using event-listeners and actionCommands might be helpful. I don't necessarily like this methods but it is convenient.

Programmatically Dismiss UIDocumentInteractionController OpenInMenu?

I am having much difficulty being able to dismiss (programmatically) my UIDocumentInteractionController's OpenIn Menu (Using the appropriate - dismissMenuWhatever method from the docs). I just can't seem to get it to work. Does anybody have any suggestions? Maybe I have an inadequate intelligence level? I am beginning to question the meaning of life.
make sure you are calling dimissMenuAnimated: on the right UIDocumentInteractionController. Maybe post some code if you still can't figure it out.