Questions tagged [user-interface]

User Interface (UI) is the system through which people interact with a computer. This tag can be used for UI-related programming questions. Note that there's a separate Stack Exchange site for User Interfaces, Interactions with the Computer and User Experience design: https://ux.stackexchange.com.

user-interface
Filter by
Sorted by
Tagged with
551 votes
9 answers
149k views

The Use of Multiple JFrames: Good or Bad Practice? [closed]

I'm developing an application which displays images, and plays sounds from a database. I'm trying to decide whether or not to use a separate JFrame to add images to the database from the GUI. I'm ...
Peddler's user avatar
  • 6,085
87 votes
4 answers
144k views

Why do I get "AttributeError: NoneType object has no attribute" using Tkinter? Where did the None value come from?

I've created this simple GUI: from tkinter import * root = Tk() def grabText(event): print(entryBox.get()) entryBox = Entry(root, width=60).grid(row=2, column=1, sticky=W) grabBtn = Button(...
Arnkrishn's user avatar
  • 30.1k
1592 votes
47 answers
837k views

How do I update the GUI from another thread?

Which is the simplest way to update a Label from another Thread? I have a Form running on thread1, and from that I'm starting another thread (thread2). While thread2 is processing some files I would ...
CruelIO's user avatar
  • 18.4k
1062 votes
23 answers
608k views

How to create RecyclerView with multiple view types

From Create dynamic lists with RecyclerView: When we create a RecyclerView.Adapter we have to specify ViewHolder that will bind with the adapter. public class MyAdapter extends RecyclerView.Adapter<...
Pongpat's user avatar
  • 13.3k
6381 votes
34 answers
1.5m views

What is the difference between px, dip, dp, and sp?

What is the difference between the units of measure px, dip, dp, and sp?
capecrawler's user avatar
  • 67.8k
134 votes
2 answers
49k views

GUI not working after rewriting to MVC

I'm practicing MVC style programming. I have a Mastermind game in a single file, working fine (maybe apart of the fact that "Check" button is invisible at start). http://paste.pocoo.org/show/226726/ ...
trevor_nise's user avatar
  • 1,367
53 votes
2 answers
84k views

Applying MVC With JavaFx

I'm new to the GUI world/OO design pattern and I want to use MVC pattern for my GUI application, I have read a little tutorial about MVC pattern, the Model will contain the data, the View will contain ...
KarimS's user avatar
  • 3,872
131 votes
2 answers
27k views

How to best position Swing GUIs?

In another thread I stated that I liked to center my GUIs by doing something like this: JFrame frame = new JFrame("Foo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane()....
Hovercraft Full Of Eels's user avatar
42 votes
3 answers
164k views

tkinter: how to use after method

Hey I am new to python and am using tkinter for my gui. I am having trouble using the frame.after method. The goal is to make a random letter appear every 5 seconds. Here is my code: import random ...
user2456977's user avatar
  • 3,850
43 votes
4 answers
68k views

Creating a custom button in Java with JButton

I am trying to create a button that has a custom shape (hexagon), but otherwise acts like a normal JButton would (that is, works with an ActionListener). I have created a class that extends ...
rybl's user avatar
  • 1,639
98 votes
8 answers
146k views

How can I schedule updates (f/e, to update a clock) in tkinter?

I'm writing a program with Python's tkinter library. My major problem is that I don't know how to create a timer or a clock like hh:mm:ss. I need it to update itself (that's what I don't know how to ...
Diego Castro's user avatar
  • 3,468
28 votes
2 answers
38k views

Making a robust, resizable Swing Chess GUI [closed]

How would I go about making this resizable Chess GUI? Our company has been tasked with making a Chess game. It needs to work on Windows, OS X and Linux/Unix machines, and we have chosen Java to ...
Andrew Thompson's user avatar
9 votes
2 answers
13k views

Netbeans GUI editor generating its own incomprehensible code

When creating a new project in netbeans, if i select JAVA Desktop application, it creates some code which I DO NOT RECOGNISE AT ALL as what i had learnt in swing. It imports packages such as : org....
YD8877's user avatar
  • 10.6k
2369 votes
24 answers
571k views

What are MVP and MVC and what is the difference?

When looking beyond the RAD (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called Model-View-Controller, Model-...
Mike Minutillo's user avatar
117 votes
8 answers
57k views

What is the need of JSF, when UI can be achieved with JavaScript libraries such as jQuery and AngularJS

I was reading about JSF that it's a UI framework and provides some UI components. But how is it better or different from number of components that are available from jQueryUI, AngularJS, React, Vue.js,...
sushil bharwani's user avatar
22 votes
2 answers
25k views

Add n rectangles to canvas with MVVM in WPF

I want to add a set of rectangles to the main window of my mvvm application. In my viewModel I've got a collection of objects which I convert to System.Windows.Shapes.Rectangle classes with a ...
Philipp Eger's user avatar
  • 2,265
14 votes
1 answer
10k views

Swing: link toggle buttons together with a button group, along with corresponding menu items

For a school project, I need to make a simple paint application that can draw lines, ovals, and rectangles. The assignment specifies that I need toolbar buttons and menu items for each type of shape. ...
Austin Hyde's user avatar
  • 26.9k
489 votes
6 answers
204k views

Declaring a custom android UI element using XML

How do I declare an Android UI element using XML?
Casebash's user avatar
  • 117k
12 votes
2 answers
22k views

How to access variables from different classes in tkinter?

I have been searching a lot and I still don't know how you access variables from different classes in python. In this case I want to access the variable self.v from PageOne class to PageTwo class. ...
Supachai Abusali's user avatar
587 votes
15 answers
267k views

Difference between a View's Padding and Margin

What is the difference between a View's Margin and Padding?
Ragunath Jawahar's user avatar
100 votes
6 answers
123k views

How do I run Selenium in Xvfb?

I'm on EC2 instance. So there is no GUI. $pip install selenium $sudo apt-get install firefox xvfb Then I do this: $Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & $DISPLAY=:1 java -...
TIMEX's user avatar
  • 266k
7 votes
4 answers
22k views

Multiple row selection in JTable

I have a JTable, that has one column that is text which is not editable and the second column is a check box that displays boolean values.... Now what i want is, when the user selects multiple rows ...
sasidhar's user avatar
  • 7,613
174 votes
18 answers
172k views

Custom fonts and XML layouts (Android)

I'm trying to define a GUI layout using XML files in Android. As far as I can find out, there is no way to specify that your widgets should use a custom font (e.g. one you've placed in assets/font/) ...
DrDefrost's user avatar
  • 1,807
103 votes
4 answers
199k views

Platform.runLater and Task in JavaFX

I have been doing some research on this but I am still VERY confused to say the least. Can anyone give me a concrete example of when to use Task and when to use Platform.runLater(Runnable);? What ...
Marc Rasmussen's user avatar
34 votes
9 answers
239k views

Formatting MM/DD/YYYY dates in textbox in VBA

I'm looking for a way to automatically format the date in a VBA text box to a MM/DD/YYYY format, and I want it to format as the user is typing it in. For instance, once the user types in the second ...
nobillygreen's user avatar
  • 1,568
4 votes
3 answers
49k views

How to set a background picture in JPanel

hello i am using JPanel as my container of my frame then i really want to used a background picture in my Panel i really need help this is my code so far . this is the updates please check here is my ...
Batusai's user avatar
  • 149
311 votes
14 answers
225k views

Create a directly-executable cross-platform GUI app using Python

Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem ...
Teifion's user avatar
  • 110k
24 votes
4 answers
29k views

Java and GUI - Where do ActionListeners belong according to MVC pattern?

I'm currently writing a template Java application and somehow, I'm not sure about where the ActionListeners belong if I wanted to cleanly follow the MVC pattern. The example is Swing based, but it's ...
jaySon's user avatar
  • 805
10 votes
3 answers
4k views

How to wire one pane to another

How do I wire output to paneWithList? PaneWithList has a listener on its JList so that the selected row is output to the console. How can I direct that output to the JTextPane on output? Could ...
Thufir's user avatar
  • 8,398
181 votes
26 answers
267k views

Move layouts up when soft keyboard is shown?

I have a few elements in a RelativeView with the align bottom attribute set, when the soft keyboard comes up the elements are hidden by the soft keyboard. I would like them to move up so that if ...
Dinedal's user avatar
  • 2,666
110 votes
15 answers
189k views

How to change the background color of the options menu?

I'm trying to change the default color for the options menu which is white: I want a black background for every item on the options menu. I've tried some shoots like android:itemBackground="#000000" ...
feragusper's user avatar
  • 1,236
55 votes
7 answers
150k views

Update UI from Thread in Android

I want to update my UI from a Thread which updates a Progressbar. Unfortunately, when updating the progressbar's drawable from the "runnable" the progressbar disappears! Changing the progressbars's ...
Filly's user avatar
  • 1,341
673 votes
18 answers
625k views

How do I align views at the bottom of the screen?

Here's my layout code; <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:...
gav's user avatar
  • 29.1k
16 votes
2 answers
47k views

Simple popup java form with at least two fields

When the user clicks a button, I want to show a popup form that should have at least two JTextFields and two JLabels, so using JOptionPane.showInputDialog is not a possibility.
nunos's user avatar
  • 21k
4 votes
2 answers
11k views

How do I create a C++/CLI Winforms app in VS2012?

I just installed Visual Studio 2012 express for Desktop. I can't see any place to create a GUI application with C++ ! Where is this "Windows Form Application" used to exists in Visual C++ 2010 ? Where ...
PeakGen's user avatar
  • 22.4k
72 votes
4 answers
60k views

In WPF, how can I determine whether a control is visible to the user?

I'm displaying a very big tree with a lot of items in it. Each of these items shows information to the user through its associated UserControl control, and this information has to be updated every 250 ...
Trap's user avatar
  • 12.2k
36 votes
11 answers
76k views

How to add placeholder to an Entry in tkinter?

I have created a login window in tkinter which has two Entry field, first one is Username and second one is Password. code from tkinter import * ui = Tk() e1 = Entry(ui) #i need a placeholder "...
Pierce's user avatar
  • 373
35 votes
2 answers
45k views

Cross-thread operation not valid [duplicate]

Possible Duplicate: Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on Okay, I know why this is giving me this error: Cross-thread ...
user avatar
12 votes
4 answers
38k views

How to set output stream to TextArea

I'm trying to create a GUI Panel for a program and I'd like everything, that would normally print to my command prompt, to print to a TextArea object. I have the GUI panel formatted for the most part, ...
Dan's user avatar
  • 649
6 votes
1 answer
9k views

how to change UI depending on combo box selection

In dialog I need to display one group of controls if some combo is checked and another group of controls otherwise. I.e. I need 2 layers and I need to switch between them when combo is checked/...
Oleg Vazhnev's user avatar
  • 23.7k
170 votes
20 answers
339k views

Android RecyclerView addition & removal of items

I have a RecyclerView with an TextView text box and a cross button ImageView. I have a button outside of the recyclerview that makes the cross button ImageView visible / gone. I'm looking to remove ...
Twentyonehundred's user avatar
121 votes
19 answers
107k views

How to crop circular area from bitmap in Android

I have a bitmap and I want to crop a circular region from this bitmap. All pixels outside the circle should be transparent. How can I do this?
Altaf's user avatar
  • 5,170
101 votes
13 answers
50k views

Line-breaking widget layout for Android

I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?...
Henrik Gustafsson's user avatar
18 votes
4 answers
29k views

Best practice for setting JFrame locations

I have a (somewhat philosophical) question relatively to Swing, or to GUI programming in general. Are there recognized best practices on where to locate the JFrame instances used in the application? ...
Scherrer Vincent's user avatar
427 votes
8 answers
1.4m views

Left align and right align within div in Bootstrap

What are some of the common ways to left align some text and right align some other text within a div container in bootstrap? e.g. Total cost $42 Above total cost should be left ...
user462455's user avatar
  • 13.3k
304 votes
12 answers
482k views

How do I add options to a DropDownList using jQuery?

As the question says, how do I add a new option to a DropDownList using jQuery? Thanks
flesh's user avatar
  • 23.9k
190 votes
11 answers
430k views

Choosing a file in Python with simple Dialog

I would like to get file path as input in my Python console application. Currently I can only ask for full path as an input in the console. Is there a way to trigger a simple user interface where ...
Mustafa Zengin's user avatar
145 votes
4 answers
75k views

Responsive website zoomed out to full width on mobile

I am testing out Bootstrap responsiveness navbar and I have a demo website. When I resize the browser on a desktop, it all works fine including the nav bar which become collapsible menu with a small ...
Laurence's user avatar
  • 7,783
87 votes
13 answers
92k views

How to detect swipe direction between left/right and up/down

My Question: How do I detect when a user moves their finger up/down vs left/right (and how do I know which direction of those groups their finger moved)? My Situation: I want to change the brightness ...
kentcdodds's user avatar
  • 28.1k
38 votes
4 answers
244k views

How do you add an ActionListener onto a JButton in Java

private JButton jBtnDrawCircle = new JButton("Circle"); private JButton jBtnDrawSquare = new JButton("Square"); private JButton jBtnDrawTriangle = new JButton("Triangle"); private JButton ...
user37037's user avatar
  • 381

1
2 3 4 5
110