titlebar

How to center align the title in a JFrame?

南笙酒味 提交于 2019-11-28 02:58:19
问题 I have a JFrame with a Title . I want center align the title , so that it appears in the middle of the JFrame's title . Thanks. 回答1: Consider leaving the title left-justified...but...this will get you near the center. For resizable frames, you need to rewrite the title on resize. JFrame t = new JFrame(); t.setSize(600,300); t.setFont(new Font("System", Font.PLAIN, 14)); Font f = t.getFont(); FontMetrics fm = t.getFontMetrics(f); int x = fm.stringWidth("Hello Center"); int y = fm.stringWidth("

How is Teamviewers Quickconnect button accomplished?

我们两清 提交于 2019-11-27 21:18:58
问题 For those of you who do not know what I am talking about: http://www.teamviewer.com/images/presse/quickconnect_en.jpg Teamviewer overlays that button on all windows to allow you to quickly share a window with someone else. I would like any ideas on implementing something similar -- if you have example code, even better (specifically, the button -- not the sharing). I am interested in C++ and QT... but I would be interested in good solutions in other languages/libraries if there are any.

How can I remove just the Maximize button from a JFrame?

放肆的年华 提交于 2019-11-27 20:24:27
I have a JFrame and want to remove the maximize button from that. I wrote the code below, but it removed maximize, minimize, and close from my JFrame . JFrame frame = new JFrame(); frame.add(kart); frame.setUndecorated(true); frame.setVisible(true); frame.setSize(400, 400); I want to only remove the maximize button from the JFrame . Make it not resizable: frame.setResizable(false); You will still have the minimize and close buttons. You can't remove the button from a JFrame . Use a JDialog instead. It doesn't have a maximize button. import java.awt.event.WindowAdapter; import java.awt.event

Android - Back button in the title bar

醉酒当歌 提交于 2019-11-27 17:07:33
In many apps (Calendar, Drive, Play Store) when you tap a button and enter a new activity, the icon in the title bar turns into a back button, but for the app I am making, it doesn't do that. How do I make that icon take you back to the previous screen? Luke F. There are two simple steps to create a back button in the title bar: First, make the application icon clickable using the following code in the activity whose title bar you want to have a back button in: ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); After you have added the above code, you will see a

Remove app title bar android

一笑奈何 提交于 2019-11-27 14:31:57
问题 I know this question has been asked million times but whichever method I use is not good for me. If I use android:theme="@android:style/Theme.NoTitleBar" in the manifest file, the whole theme of the app changes. If I put requestWindowFeature(Window.FEATURE_NO_TITLE); in the onCreate activities, it shows up shortly when starting an app. Btw I don't have any theme selected, just using standard android. 回答1: It is unclear what you mean by "whole theme of app changes". For API Level 11+ devices,

Dragging custom window title bar from top when maximized does not work

时间秒杀一切 提交于 2019-11-27 14:01:53
问题 I have a custom title bar and with the window style set to none. On the click of the title bar I check to see if it is a double click (that does window maximize and restore) if it is not double clicked I do Window.DragMove . This works great for the snapping to the side and top. But when I try to drag the window when it is maximized (which would normally restore the window down), it doesn't do anything. Here is my code: static Window Window { get { return Application.Current.MainWindow; } } /

Draw Custom Buttons on Windows Vista/7 Aero Titlebar

强颜欢笑 提交于 2019-11-27 14:01:30
问题 I found this question on StackOverflow. Basically, the user wanted to draw custom buttons on the titlebar. I tried the code and realised it works in vista/7 only when Aero is disabled. My question is, is there any way to draw custom buttons on the titlebar while aero is enabled? Also, is there any way of reading information from the current theme so I can style my buttons to match the already existing ones. Update Here is a screenshot from my computer demonstrating the above concept. I got

How do you change the text in the Titlebar in Windows Forms?

邮差的信 提交于 2019-11-27 13:24:58
I am trying to set a condition that would change the writing inside the title bar... But how do I change the title bar text? Alpine You can change the text in the titlebar in Windows Forms by using the Text property. For C# // This class is added to the namespace containing the Form1 class. class MainApplication { public static void Main() { // Instantiate a new instance of Form1. Form1 f1 = new Form1(); // Display a messagebox. This shows the application // is running, yet there is nothing shown to the user. // This is the point at which you customize your form. System.Windows.Forms

Android activity as dialog, but without a title bar

落爺英雄遲暮 提交于 2019-11-27 12:32:26
I have an activity that has the following set as theme: android:theme="@android:style/Theme.Dialog" However, there is a title bar in the activity-dialog that appears, that uses up the little available space that I have. How can I remove it? Femi Try doing requestWindowFeature(Window.FEATURE_NO_TITLE); in onCreate . It'll need to be done immediately after calling super.onCreate and just before setContentView . For those who are using AppCompatActivity , above answers may not work. Try this supportRequestWindowFeature(Window.FEATURE_NO_TITLE); immediately before setContentView(R.layout

Remove Android App Title Bar

喜欢而已 提交于 2019-11-27 11:53:06
I understand that these properties in the manifest: android:theme="@android:style/Theme.NoTitleBar" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" can remove the title bar. However, I constantly check the Graphical Layout when I am modifying my app. When I look at the Graphical Layout I still see the title bar. I want to remove the title bar in a way that I don't have to see it during the development of the game. Alex Gittemeier In the Design Tab, click on the AppTheme Button Choose the option "AppCompat.Light.NoActionBar" Click OK. Simple way getSupportActionBar().hide(); for