Java Help Jpanel

8 views
Skip to first unread message

kasunpr...@gmail.com

unread,
Sep 4, 2015, 5:16:20 AM9/4/15
to Techකතා
Man Meke Divider Location ekak set kala but eka hariyata wada karanne na.

mata oni panels deka hariyata dekata bedennai


import javax.swing.*;
import java.awt.*;


public class swi1{

private JFrame frame;

public swi1(){


frame = new JFrame("Gui");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("frame");
frame.setBounds(400,400,500,500);
frame.setLayout(null);


JSplitPane myspil = new JSplitPane();
myspil.setOpaque(true);
myspil.setDividerLocation(150); // Man me Ganai kiyanne
frame.setContentPane(myspil);
frame.setVisible(true);


JPanel right = new JPanel();
right.setBackground(new Color(255,0,2));
JPanel left = new JPanel();
left.setBackground(new Color(255,185,55));

myspil.setRightComponent(right);
myspil.setLeftComponent(left);






}
public static void main(String []args){

new swi1();

}

}




Capture.JPG

Bishan

unread,
Sep 6, 2015, 11:14:55 AM9/6/15
to tech...@googlegroups.com
Replace
myspil.setDividerLocation(150);
with
myspil.setResizeWeight(.5d);
> --
> ටෙක්කතා සමූහය සඳහා ආචාර ධර්ම
> http://www.techkatha.com/rules-and-regulations/
>
> ඔබට මෙම පණිවිඩය ලැබෙන්නේ ඔබ Teckකතා හි සාමාජිකයෙක් බැවිනි.
> ලිවීම සඳහා tech...@googlegroups.com වෙත ලියන්න.
> Teckකතා හින් ඉවත්වීම සඳහා http://googlegroups.com/group/techkatha/subscribe
> වෙත යන්න.
>
> වෙබ් අඩවිය http://www.techkatha.com
> ---
> You received this message because you are subscribed to the Google Groups
> "Techකතා" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to techkatha+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


--
http://magics4me.blogspot.com http://socialmysite.appspot.com
♠♦ මැජික් | Magic ♥♣ Free Social Bookmarking and SEO Tool
ඉන්ද්‍රජාල ඉගෙන ගනිමු.
Reply all
Reply to author
Forward
0 new messages