+ 1
In java GUI , shall we make a package of creating a link ?
for eg. import java.swing.CreateLink;
10 odpowiedzi
+ 1
please elaborate.
+ 3
No.
I suggest keep the inbuild pakage default as it is if you really need to make pakage then create in separate file but not in the standard package.
+ 2
I think you misunderstood the concept of packages and classes here in
import java.util.Scanner ;
util is the package name and Scanner is the class and we create the Object of class Scanner like wise swing is package too and if you want to create class named CreateLink you can just create package and put that class into the package and then import it just like
package Link;
class CreateLink{
//your code goes here
}
--------------------------------------
then
import Link.CreateLink;
CreateLink cL = new CreateLink();
+ 2
apparently not but if you can make it to Jpanel and then add both into the one JFrame.
+ 2
JFrame one = new JFrame();
JFrame two = new JFrame();
for Merging
Jpanel one = new JPanel();
Jpanel two = new JPanel();
Box merged = Box.createVerticalBox();
merged.add(one);
merged.add(two);
JFrame newFrame = new JFrame();
newFrame.add(merged);
newFrame.setVisible(true);
+ 1
Let's take an example :
the package :-
import java.util.Scanner; In this package , we will make an object of accepting the input . for eg.
Scanner accept = new Scanner(System.in);
like that , I am thinking that , if we make an object of Createlink as ;
Createlink obj = new Createlink();
and we can attach the link by predefined method as ;
obj.Link(new URL:"https://www.google.com");
Its just an example . I will think that if we make this package then ..............
+ 1
what I am asking sir ?
if this package will make inbuilt in java then ..? shall we make an inbuilt package for java like this or not ?
+ 1
Thank you for your suggestion sir !
but I have one more doubt ?
+ 1
happy to help
+ 1
can we merge two frames in one using swing ? with their different functions ?