button,layout,javafx,position,location , Position JavaFX Button in a specific location

Position JavaFX Button in a specific location


Tag: button,layout,javafx,position,location

My Question is how can i position a javafx button in a specific location.

All the time that i tried to do this simple code is resulting that the Button is only located in the Center of the screen and not on my desired location.

(I'm using StackPane)


Button button = new Button();


Thanks in advance ,



If you want to specify the exact co-ordinates of your node, you can use a Pane instead of StackPane.

Your button, if added to a StackPane or similar layout which supports alignment, must use the translate properties to move the button. You cannot use setLayoutX() or setLayoutY() with these layouts.

Try using the following command to move the button from its initial location :



One button with 2 actions

I did try to make 1 button that makes 2 actions: one on the 1st press (click), the other on the 2nd press (click), and repeat. However, none of my approaches worked for me, so I made 2nd button to make 2nd action, but I would really like to have...

C# Delete Row with Dynamic Textbox/Button/Grid

I've tested some thinks with Dynamic Textboxes and Buttons, Adding Items to my Grid works very well, but if I want to Delete it there are some Bugs, sometimes 1 Row is empty and my Add Button disappears or my Program crashs. What did I wrong or what did I...

Java: Action Handler

I am working on a problem for school and I am having an issue with the CalculateButtonHandler. I am also using an ExitButtonHandler but that is not giving me any issues. I have tried re-reading my textbook and have searched the web. After racking my brain over this issue I...

How do you make a div only extend in one direction when the outer container size increases?

I'm trying to make a a page container with a navigation bar on the left (inside of the container). When the outer page is wider than the container, I would like just the navigation bar to extend left up to a certain size while the rest of the container's contents...

How to use custom css file for layout of a module in Yii2

I am using basic pack of Yii2. I created a module named Admin and I want this module has it own layout but i don't know where to put all its css files. Then, how to include them in layout.php. My dirs like this: basic -- module -- admin --...

Eclipse Layout: static instead of relative values?

I have a layout with two Buttons. One button is in the Center of the left half, and the other button is in the Center of the right side. But I use relative values (left="60dp" etc.). How can I have the same result with static values? Because I don't want...

How to access file from another function

I'm currently working on a C# WPF application which looks something like the following. What I am trying to do is this, the first button, when pressed, basically opens up a browse dialog box where you can select multiple files. I want access to those paths inside my other button...

Beginner:What do several parts of my code mean? [on hold]

Because I'm an absolute beginner I have a really simple question but I can't help myself.Maybe they are too simple because I can't find the answer in forums, books or other internet paged. I do not get the meaning of some parts of my java code because i just knew...

Active Bootstrap Buttons

I have just been playing around with Bootstraps Button Group to show and hide div's on my webpage. Perhaps I am being dumb, but could anyone point me in the right direction for making the selected button active when clicked? HTML (Buttons): <div class="btn-group" role="group" aria-label="..."> <button id="1" type="button" class="btn...

How to achieve the following in extjs

--Title------------------------------- | | | | | <Content> | | | |_____________________________________| How to achieve the above panel in extjs? Edit: It should look something like this: http://oi57.tinypic.com/eiw49.jpg...

my done button somehow went to a blank page and delete won't work unless I refresh -ajax

I am playing around with a todo list I learned online. Trying to add ajax into it. Works well when I try to add an item. When an item is added there's a button says 'Mark as done' so I can click on it and then there will be a...

Why these ImageButtons(delete and update) are overlaying

this .xml will be the layout of the item in the RecycleView list, but the last two Buttons are overlaying <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#Ffffff" android:baselineAligned="false" android:weightSum="1"> <LinearLayout android:id="@+id/thumbnail" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="3dip"...

Multiple screen support Windows Phone 8

I used to develop for Android and iOS, and for multiple screen support we use to use mdpi, hdpi, xhdpi. Now I want to develop for Windows Phone, I want to set a background to a button and I don't know how to define image size to support all screen...

UICollectionView layout issue on iphone 5

I have a problem with my UICollectionView, I have 3 columns and everything works fine instead of iphone 5 and 4. In iphone 6 my collectionview looks that (width in cell): Iphone 5 with cells: The problem is, when in last row, I have 2 cells, and it looks like...

Add block to all CMS Pages with certain URL Key

I'm trying to discover whether this is possible or not. We have a series of CMS pages that represent our library. So the URL keys for these pages are something like: library/ library/top-ten library/five-questions library/faq etc... The powers that be want to add a static block that will appear only...

How do I get values dynamically from radio buttons?

This is an on change event for anything changed on the page. $(this).change(function(){ type = $('input[name='+$(this).name+'radioName]:checked', '#myForm').val(); alert(type); }); I want to get the radio button that is clicked. So I can show the hidden input box when Profit is clicked. <TD align=left> <input type=radio name="Red" value="l" checked>Loss <input type=radio...

Designing layout android

I am currently trying to create a list view which will show details about a post. For that, I have created xml file for designing the list item. This is the final look I want for my activity. So far I have succeeded dealing with the rounded corners, image buttons...

Move textview from top to bottom

In the image above I want to move the textview containing bill microsoft under the image and the other textview. How can I do this? I have written this layout right now. <android.support.v7.widget.CardView android:id="@+id/card_tracks" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="180dp" android:layout_gravity="center" android:layout_margin="16dp" android:elevation="7dp"> <LinearLayout android:id="@+id/main_ll" android:layout_width="match_parent"...

Update label's text when pressing a button in Kivy for Python

Here is my code: I want to make a game where the main_label changes text when you press a button but I've looked everywhere for a week and still don't understand how to do it. I looked on Kivy's website but I don't understand. As you can see I'm new...

Dynamically Resizing Controls on Windows Forms

I has a winform which can be resize. I has 4 chart control in the form and sit side by side. When the form is in maximum size, the layout of each chart control is run out. I try to set the anchor style but i got no luck. How...

What's the layouts folder for in Rails?

I understand that .html.erb files go within app/views or its subfolders. But what is the app/views/layouts folder in particular for in Rails?

How do you create a button that will display a random result from an array in javascript?

I've been trying to create a button that will take a random name from an array, and display it on an html page. Been trying for a long while to get this to work, with no results. What gives? As well, if you know the answer, how could I create...

Javascript: call dialog from button

I hope you can help me, because i'm new at javascript. I want to open a dialog by clicking on an button. When it shows up and you click "OK", there should pop-up a second dialog. http://forums.asp.net/t/1962249.aspx?Make+a+button+open+a+javascript+dialog And also on stackoverflow i saw related questions. But none of them could...

How to remove button border style?

In autohotkey, how do you remove the black button border? I just want a button without any border on it. I've tried all these style modifiers to no avail. gui, add, button, hwndMyButton Control, Style, -0x0,, ahk_id %MyButton% ;remove BS_PUSHBUTTON Control, Style, -0x1,, ahk_id %MyButton% ;remove BS_DEFPUSHBUTTON Control, Style, +0x8000,,ahk_id...

Change extends(layout) dynamically in laravel 5

I have been trying to change layout dynamically in laravel by just passing a variable in @extends('default1.master') to $var = default2 @extends('$var.master') possibly @extends($var.'.master') tried a lot but unable to find a solution all I get is error in my syntax or view not found....

How to handle event from multiple buttons of same name

I am working on a small practice program where I have 3 white boxes in a row. My goal is (using Javascript) for any of the boxes to change from white to red when the mouse is over the box, and then to turn yellow when the mouse comes off...

One controller uses its corresponding layout, but the other does not

My Rails project has two controllers, a SessionsController and a CustomersController. My project also has two layout views in the layouts directory, sessions.html.erb and customers.html.erb. I would like the SessionsController to render using the session.html.erb layout and the CustomersController to render using the customers.html.erb layout. I have removed all explicit...

My button doesn't work

This is the main activity, where I click the button public class NewAddMarketingProg extends Activity implements OnClickListener { private StartAppAd startAppAd; String note_detail; ListView lvNote; String[] data; private int mIndex; private MarketingProgramsAdapter adapter; private Context context; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* StartAppSDK.init(this, getString(R.string.account_id), getString(R.string.app_id), true);*/ setContentView(R.layout.newaddmarketingprog);...

JButton listener not firing

I seperated my codes into MVC model and now my confirm button action listener is not printing the username and password even though I added a Actionlistener for it. please help thanks. Codes LoginDialog.java import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog;...

How to change textView in separate ViewController from button in another ViewController?

I have a Collections View that includes various cells that are also buttons. Upon clicking one of those buttons, a separate ViewController is shown (I just connected the button to the ViewController and clicked "show"). I would like to know how to switch the textView in that separate ViewController for...

In WPF how can I control whether another button clicked

I want to determine another button is clicked in wpf. I wrote same code as below, when I clicked that button the animation works after that when I clicked same button the animation work like as else block. But I want to control if another button is clicked and than...

How to link code for button function to checkboxlist in C#?

I would like to link the function of my Chart Output Button to the items in my check box list such that when an item in the check box is selected or deselected, the page is reloaded again and my chart is refreshed. My codes to refresh the chart have...

Dynamically change a button-drop list in javascript?

Trying to create a changeable button-drop-down from Bootstrap HTML in conjunction with Javascript. The HTML looks as: <div class="btn-group"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> Menu <span class="caret"></span> </a> <ul class="dropdown-menu"> <li><a href="#">Choice1</a></li> <li><a href="#">Choice2</a></li> <li><a href="#">Choice3</a></li> <li class="divider"></li> <li><a...

How to Randomly Choose Button Text in Java?

Friends, I am a Civil Engineer. Now i am working now in Android Developing. I know Java and C# but i am mentally set my Programming knowledge is only editing like Reading and Understand. How to increase my skill like writing Programs Specially for C# and Java. Thank You. then...

How can I keep a group of buttons centralized on the right side of the footer?

I've been trying to keep four buttons centralized on the right side of the footer, but it seems like the footer is set to percentage instead of pixels, I've tried to set it to percentage, but it ignores my "orders", how can I set the footer to 60px, and put...

Having one button in ng-repeat change color when clicked, not all using Angularjs

Hi I'm trying to make my done button change green when clicked. The first time I attempted this, it changed all the buttons green. index.html <tbody> <tr ng-repeat="plan in scheduler.plans | orderBy:'standardTime'"> <td class="plan-time">{{plan.displayTime}}</td> <td class="plan-duration">{{plan.duration}} minutes</td> <td class="plan-task">{{plan.task}}</td> <td><button type="button" ng-class="{'btn-primary': !scheduler.clicked, 'btn-success': scheduler.clicked}"...

WPF custom button

I start to learn WPF and there is something that is still unclear for me: i created new Style for button: <!-- no border button style --> <Style x:Key="NoBorderButton" TargetType="Button"> <Setter Property="Foreground" Value="White" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderThickness" Value="0" /> <Style.Triggers> <Trigger Property="Control.IsMouseOver" Value="true">...

strange behaviour with UINavigationController and autolayout top layout guide

I am using auto layout for a controller under navigation controller. For this controller, I mainly have a scroll view inside the controller's view. the alignment rule for the scroll view is top layout guide, bottom layout guide, leading aligned with super view and trailing as well. the layout is...

Border some cells in table via CSS

In a very basic table I would like to put a border around some specific cells. I created for instance this table: <?php echo '<link rel="stylesheet" type="text/css" href="style1tt.css">'; echo '<table>'; echo '<tr> <th>name</th> <th>score</th> <th>position</th></tr>'; echo '<tr> <td>Bart</td> <td>189</td> <td>2</td></tr>'; echo '<tr> <td>Shirley</td> <td>211</td> <td>1</td></tr>';...

An activity with two listviews in android

MainAcitivity public class MainActivity extends Activity { ListView list, listYear; String[] web = { "Google Plus", "Twitter", "Windows", "Bing", "Itunes", "Wordpress", "Drupal" } ; String[] year = { "2012", "2013", "2014", "2015", "2016", "2017", "2018" } ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); list=(ListView)findViewById(R.id.list); list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, web));...

Using CSS :after to shade a button:hover

I'm trying to add a bunch of different color classes to my buttons and allow additional classes to be added arbitrarily. All of these should darken on hover. It seems tedious to write button.(color):hover rules for every single color, so I've written this such that the :after section gets darker...

App crashing after pushing button, but the action is working

Maybe someone sees an error, the problem is that when i push btn2 (button 2) and btn3 (button 3) app crashes, but action still works, i.e video is running and PDF opens, while button 1 is working correctly... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); configureImageButton(); mCamera = getCameraInstance();...

Is it possible to share multiple text by using share intent?

I intend to share 6 text information, however it always shows the last information only, i.e. share.putExtra(Intent.EXTRA_TEXT, Contact); I also tried to use a string array to store all 6 information, i.e: share.putExtra(Intent.EXTRA_TEXT, stringArray); However, it still doesn't work. Can anyone help ? Thank you. My code: public class SingleJobActivity...

How to put a layout below other layout in Android

I have this code: RelativeLayout frame = new RelativeLayout(activity); RelativeLayout layout = new RelativeLayout(this); RelativeLayout.LayoutParams dateArea = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MATCH_PARENT, 90); dateArea.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics(); int height = displayMetrics.heightPixels; RelativeLayout mapLayout = new RelativeLayout(this); RelativeLayout.LayoutParams mapParam = new RelativeLayout.LayoutParams(...

AS3: Fast hovering doesn't execute rollOut

I'm having a serious problem that is getting me nervous: I've made a button _btn that includes ROLLOVER and ROLLOUT animations with coding (an nested movieclip instance called barra that increases to half alpha when you hover over and decreases when you hover out). [Here it should go a descriptive...

Multiple Alignments Inside Button

Can you make a single string, within the same button, have different alignments? For example: dim String1 = "A B C D E F" A - would be in the top left corner B-in the middle top..... ...

How to get an entry.bind and a button do the same thing?

I think the name of the topic is pretty clear, I haven't found any answer elsewhere so I came to ask for it. I have a tkinter GUI with an entry and a validation button. I'd like to call the same function when I press a key in the entry,...

java Swing: how to keep one component left aligned with another component centered with respect to parent

Say I have two components, A and B, in a JPanel. I want Component A to stay left aligned, while Component B does its best to stay in the middle of the panel. I mocked up the following demo (sorry for the quality, I made it in paint): What I...

Where to place SlidingTabLayout.java and SlidingTabStrip.java files in project?

I'm very new to Android studio and I'm currently following a tutorial that implements a sliding tab layout for an application. The tutorial says to put SlidingTabLayout.java and SlidingTabStrip.java in our project, but doesn't say exactly where. For now, I just put declared them as two classes and put them...

I want my button to call a method in a fragment

So I have (WorkoutList Activity) -> (WorkoutList Fragment) -> (ExerciseList Fragment) -> (addExercise Fragment) Theres a button in AddExercise, and I want it to invoke a method in ExerciseList The problem is that with the current set-up I'm getting `Attempt to invoke virtual method void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object...