I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Four coordinate are required For drawing the rectangle in the java applet. First two coordinate define the origin point of the rectangle. Origin point start from upper left corner and further x-coordinate increases width of the rectangle in right side and y-coordinate increases height of the rectangle in downward.
Syntax of drawRect in Java Applet
Graphics_Instance . drawRect(int X1, Int Y1, int Width, int Height);
If you want to set border color of the rectangle then use setColor( ) method of Graphics class, which is exist in java.awt package.
Example - designline.java
import java.awt.*;
import java.applet.*;
public class designline extends Applet
{
int width, height;
public void init() {
setBackground( Color.gray);
}
public void paint( Graphics g ) {
g.setColor( Color.red );
g.drawRect( 11, 22, 101, 50 );
}
}
First to compile the code and create the class file for this
Prepare the HTML file in the same location with <applet> tag. Like
<applet code="designline" width="400" height="400" />
Save the .html file in same location also run in any browser.
Syntax of drawRect in Java Applet
Graphics_Instance . drawRect(int X1, Int Y1, int Width, int Height);
If you want to set border color of the rectangle then use setColor( ) method of Graphics class, which is exist in java.awt package.
Example - designline.java
import java.awt.*;
import java.applet.*;
public class designline extends Applet
{
int width, height;
public void init() {
setBackground( Color.gray);
}
public void paint( Graphics g ) {
g.setColor( Color.red );
g.drawRect( 11, 22, 101, 50 );
}
}
First to compile the code and create the class file for this
<applet code="designline" width="400" height="400" />
Save the .html file in same location also run in any browser.
Comments
Post a Comment