I am working a billing software development and I have faced some problems during hiding the grid lines I hid my table's grid lines using tablename.setShowGrid(false) method.
I have also set background for some specified rows. After hiding grid lines it shows as white lines within the background set rows.
I am pretty sure that you set everything visible at the end of the source code. This happend to me too. My advice: Set everything manually visible or not visible. Yeah, that is way more code as usual, but you can see what should be visible and what shouldn't.
I hope I can help you. And I am sorry for my bad English.
Related
I am in the process of creating my first JavaFX application. I use SceneBuilder to design the GUI. I am facing the following problem:
I have dragged a Pane inside the GridPane. The Pane seems to have to follow the constraints given by RowConstraints and ColumnConstraints. The problem is that these are not aligned with my pane:
I did not expect this to be a big problem, but this results in a gap that is visible when I run my code:
I am talking about the white-colored part in this figure - I want this to be blue. Also, I want to see the entire pane in my window.
I played around and tried to figure this out on my own, but I don't see what I am doing wrong. Any ideas?
What seems to fix the issue is the following:
Inside the Inspector, open the Layout-entry for ColumConstraints. Change HGrow and HAlignment from INHERIT to ALWAYS and LEFT, respectively.
But if anyone knows more about this, feel free to post a separate answer!
I'm making a program in java that recive some strings and then display them in a new frame scolling them in one line, like the news, (shown below)
There, the text are displayed in a line, like what I need, but my problem is that I don't know what I should use in java, I though about put a panel on a frame and then a textfield inside the panel, then I realize that it's impossible because for every message I may need to change the color of background for an highlight message...
So, if anyone can help me, can you tell me what should i use for the diferent message and how i can get the text scrolling?
Thank you all in advance!
I have a JTable in a JScrollPane but I'd like to change the look of the ScrollBar to something a bit better looking; a 'custom design'. Maybe put an image that a user can drag instead of the default thick blue bar. Is this even possible?
The main thing I'd like to do is change the thickness of the bar. My application uses a small window and the ScrollBar looks too thick.
Any help will be much appreciated.
Edit:
Thanks for the responses so far. I just found this; answers my answer, in part: java scrollbar thickness
Unfortunately I cannot provide a sample at the current moment, but you should definitely look into this
The BasicScrollBarUI class allows you to modify different features of a typical JScrollBar, such as various different colors, sizes, and shadow effects. This should be what you are looking for. Basically the idea is that you are supposed to override the installDefaults method and just modify the protected fields to your liking.
But, if you want to get fancy, I would highly suggest looking into JavaFX due to the amount of customizability it supports, one being CSS styling (which should be very helpful to you).
I'm having an issue where I have 4 form fields in a fieldset. If certain conditions are met, I use setVisible(true/false) to hide or show the fieldset.
I'm running into a problem where I originally hide a fieldset, but when I make it appear, it doesn't display the labels and textfield boxes.
If I do it in reverse, where I show the fieldset, then hide it later, I have no problem switching between the views and having it show up properly.
I use an HBoxLayout for the fieldset. I'm wondering if it's the layout that could potentially be causing the problem or maybe it's the rendering order?
Does anyone have a workaround or solution?
Thanks.
The workaround I found was removing and adding the fields again. It's still not identical, the fields seem to be pushed over a bit from the left side, but it at least shows up again.
I'm just figuring out my way around SWT. I have a little problem that i cant seem to solve. I have a check-box in my window. When the check-box is checked, i would like add a multi-line, read-only, text box below it, lets say 200x200. I want the height of the window to increase to accommodate this text-box. When the check-box is unchecked I'd like the opposite to happen.
Could you help me with this? I can't find an example but maybe I'm not using the right keywords. Cheers.
--EDIT
the.duckman'ss answer was very helpful. I've managed to get it working to some extent. I'm adding a multi-line textbox 480px high. How do I automatically resize the window to accommodate the text box? When the user checks the checkbox, the textbox shows up but the height of the window doesn't increase to accommodate the textbox. My code is a little long so I've put it in PasteBin — http://pastebin.com/01RxKeEr
Thanks.
I recommend looking at the SWT Snippets to every beginner - that's probably the best place to go to with SWT questions.
This snippet does exactly what you want.
Edit
Ooops, I ignored the second half of your question, sorry. Simply add this line to your listener:
shell.setSize(shell.computeSize(SWT.DEFAULT, SWT.DEFAULT));