Questions tagged [setbounds]

In `Java`, `setBounds()` is a method that resizes swing components

In Java, setBounds() is a method that resizes swing components with the syntax (x-dimension, y-dimension, width of component, height of component). setBounds() is a hybrid of setSize() and setLocation(). The (x,y) location is relative to the parent of the component.

75 questions
0
votes
2 answers

Adding Components to Frame using Absolute Positioning

I am creating a simple Tic Tac Toe Application in Swing using setBounds (null Layout). My problem is that whichever component i add in the end, is not visible in the frame, or distorts the complete GUI. My code would better explain this import…
Gagan93
  • 1,826
  • 2
  • 25
  • 38
0
votes
1 answer

How to set bounds to components in a JPanel?

I have added the components to a JPanel and that JPanel to a JScrollPane. But I need to give specific bounds to the components that I have added(without using a layout manager).When use a null layout to set the bounds that scroll bar is not visible.
user2723764
  • 25
  • 1
  • 2
  • 6
0
votes
2 answers

drawLine component with setBounds

I have a problem that I can't seem to fix with my Java code. I've created a program that shows a map, when u click on the map, u get a edge/node dotted out on the map.. When I connect two nodes with each other, a line is to be shown between the…
Jorgeuos
  • 541
  • 6
  • 28
0
votes
2 answers

Set limit integers to JTextField

How to set a limit to the input for user, I mean that the user can input only like 2 or 4 integers and no more. Code: JLabel dateD = new JLabel("| Date Day:"); dateD.setBounds(170,270, 120, 25); dateDD = new JTextField(); …
Denis Nurasy
  • 41
  • 1
  • 8
0
votes
1 answer

xCode Tableview set bounds

Trying to set the bounds of my table view to be smaller than my screen. I am setting it in my viewDidLoad method but nothing happens when I run. Not sure why it's not working. Am I calling it in the right place?? //OptionsViewController.m -…
mablecable
  • 385
  • 1
  • 6
  • 15
0
votes
3 answers

Animating form resize in VB.NET

I have a form positioned slightly above the taskbar/system tray in the bottom right corner of my desktop window. It's sort of like a pop-up notification. The notification itself looks great, but there's a button on it which resizes the form up,…
Andy E
  • 338,112
  • 86
  • 474
  • 445
0
votes
1 answer

IOS setTransform and actual Bounds/Frame

I am resizing a view with the setTransform method. Because i dont want the view to get too small, i got a check like this: if(view.bounds.size.width > 100 && view.bounds.size.height > 100 && view.bounds.size.width < 300 && view.bounds.size.height <…
Oritm
  • 2,113
  • 2
  • 25
  • 40
0
votes
3 answers

ignored setbounds

I simply would like to place my JButton by the setBounds method. But whatever the parameters of this method, the button is on the middle at the top. This is my code : import javax.swing.JButton; import javax.swing.JLabel; import…
giovedy
  • 123
  • 2
  • 4
  • 10
0
votes
2 answers

aDrawable.SetBounds(...) doesn't work

I can't succeed to put a custom centered overlay item on my map. It always appears centered on bottom and middle. Here is my code: ------------My overlay item class------------- public class EditionThumbOverlayItem extends OverlayItem { public…
0
votes
2 answers

setBound width and height

This method gets called after i resize a photo: - (void)correctSize:(UIView*)view{ //check if the newWidth is rounded by 50 CGFloat correctWidth = roundf(_lastScale*_lastWidth/XPCollageGridHorizontalStepSize) *…
Oritm
  • 2,113
  • 2
  • 25
  • 40
-1
votes
1 answer

Image moving to the target

A and C images are far away. At this time, B image is created from the coordinate values ​​of A For each iteration, x, y must be moved to arrive at the C image coordinate value. For example, A (100,100), C (300,300) Starting at B (100,100), Each…
jsc0000
  • 11
  • 1
-1
votes
2 answers

JPanel setbounds

I'm trying to add a JPanel to another JPanel, and placing it in a specific location on the first JPanel. I'm doing this with setBounds(x, y, w, h). Now I know I shouldn't do this, but I need a way to move it around (as an animation). The problem…
-1
votes
2 answers

JLabel not showing in inner JPanel

Why does my Inner JPanel not display my JLabel text? I have an outer JPanel, and an inner JPanel to display some text with the right dimensions. However I don't understand why it won't show? JPanel jp = new JPanel(); …
FareJump
  • 113
  • 2
  • 10
-1
votes
1 answer

Why will image not add when JFrame has .setSize

I'm a somewhat novice programmer and I'm have some trouble adding an image to my frame. While I know how to add images generally, this specific case it does not work. public class Tutorial extends JFrame{ Tutorial(){ JFrame frame = new…
-2
votes
1 answer

How to move jlabel in between two points?

I have two point and I draw a line with drawline(x1,y1,x2,y2); I would like to move a label on this line (between this two points). m=y2-y1/x2-x1; if(x1
1 2 3 4
5